diff options
| author | Kenichi Handa | 1998-08-15 01:28:14 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1998-08-15 01:28:14 +0000 |
| commit | 16cd5029243337639a536b8cc972d6938ca61754 (patch) | |
| tree | 53940e7a925dc3157e3a42cbd8c8850751e3d486 /src | |
| parent | ab29c43b51181a352461867ab822814cf48ee7ec (diff) | |
| download | emacs-16cd5029243337639a536b8cc972d6938ca61754.tar.gz emacs-16cd5029243337639a536b8cc972d6938ca61754.zip | |
(Vnext_selection_coding_system): New variable.
(selection_data_to_lisp_data): If Vnext_selection_coding_system is
non-nil, use it.
(lisp_data_to_selection_data): Likewise.
(syms_of_xselect): Declare next-selection-coding-system as a Lisp
variable.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xselect.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/xselect.c b/src/xselect.c index b05a21ea453..74f0393d1fd 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -51,6 +51,9 @@ static Lisp_Object Vx_sent_selection_hooks; | |||
| 51 | selection, and clipboard. */ | 51 | selection, and clipboard. */ |
| 52 | static Lisp_Object Vselection_coding_system; | 52 | static Lisp_Object Vselection_coding_system; |
| 53 | 53 | ||
| 54 | /* Coding system for the next communicating with other X clients. */ | ||
| 55 | static Lisp_Object Vnext_selection_coding_system; | ||
| 56 | |||
| 54 | /* If this is a smaller number than the max-request-size of the display, | 57 | /* If this is a smaller number than the max-request-size of the display, |
| 55 | emacs will use INCR selection transfer when the selection is larger | 58 | emacs will use INCR selection transfer when the selection is larger |
| 56 | than this. The max-request-size is usually around 64k, so if you want | 59 | than this. The max-request-size is usually around 64k, so if you want |
| @@ -1504,8 +1507,11 @@ selection_data_to_lisp_data (display, data, size, type, format) | |||
| 1504 | unsigned char *buf; | 1507 | unsigned char *buf; |
| 1505 | struct coding_system coding; | 1508 | struct coding_system coding; |
| 1506 | 1509 | ||
| 1510 | if (NILP (Vnext_selection_coding_system)) | ||
| 1511 | Vnext_selection_coding_system = Vselection_coding_system; | ||
| 1507 | setup_coding_system | 1512 | setup_coding_system |
| 1508 | (Fcheck_coding_system(Vselection_coding_system), &coding); | 1513 | (Fcheck_coding_system(Vnext_selection_coding_system), &coding); |
| 1514 | Vnext_selection_coding_system = Qnil; | ||
| 1509 | coding.mode |= CODING_MODE_LAST_BLOCK; | 1515 | coding.mode |= CODING_MODE_LAST_BLOCK; |
| 1510 | bufsize = decoding_buffer_size (&coding, size); | 1516 | bufsize = decoding_buffer_size (&coding, size); |
| 1511 | buf = (unsigned char *) xmalloc (bufsize); | 1517 | buf = (unsigned char *) xmalloc (bufsize); |
| @@ -1643,8 +1649,11 @@ lisp_data_to_selection_data (display, obj, | |||
| 1643 | unsigned char *buf; | 1649 | unsigned char *buf; |
| 1644 | struct coding_system coding; | 1650 | struct coding_system coding; |
| 1645 | 1651 | ||
| 1652 | if (NILP (Vnext_selection_coding_system)) | ||
| 1653 | Vnext_selection_coding_system = Vselection_coding_system; | ||
| 1646 | setup_coding_system | 1654 | setup_coding_system |
| 1647 | (Fcheck_coding_system (Vselection_coding_system), &coding); | 1655 | (Fcheck_coding_system (Vnext_selection_coding_system), &coding); |
| 1656 | Vnext_selection_coding_system = Qnil; | ||
| 1648 | coding.mode |= CODING_MODE_LAST_BLOCK; | 1657 | coding.mode |= CODING_MODE_LAST_BLOCK; |
| 1649 | bufsize = encoding_buffer_size (&coding, *size_ret); | 1658 | bufsize = encoding_buffer_size (&coding, *size_ret); |
| 1650 | buf = (unsigned char *) xmalloc (bufsize); | 1659 | buf = (unsigned char *) xmalloc (bufsize); |
| @@ -2288,6 +2297,14 @@ the text is encoded or decoded by this coding system.\n\ | |||
| 2288 | A default value is `compound-text'"); | 2297 | A default value is `compound-text'"); |
| 2289 | Vselection_coding_system = intern ("compound-text"); | 2298 | Vselection_coding_system = intern ("compound-text"); |
| 2290 | 2299 | ||
| 2300 | DEFVAR_LISP ("next-selection-coding-system", &Vnext_selection_coding_system, | ||
| 2301 | "Coding system for the next communication with other X clients.\n\ | ||
| 2302 | Usually, `selection-coding-system' is used for communicating with\n\ | ||
| 2303 | other X clients. But, if this variable is set, it is used for the\n\ | ||
| 2304 | next communication only. After the communication, this variable is\n\ | ||
| 2305 | set to nil."); | ||
| 2306 | Vnext_selection_coding_system = Qnil; | ||
| 2307 | |||
| 2291 | DEFVAR_INT ("x-selection-timeout", &x_selection_timeout, | 2308 | DEFVAR_INT ("x-selection-timeout", &x_selection_timeout, |
| 2292 | "Number of milliseconds to wait for a selection reply.\n\ | 2309 | "Number of milliseconds to wait for a selection reply.\n\ |
| 2293 | If the selection owner doesn't reply in this time, we give up.\n\ | 2310 | If the selection owner doesn't reply in this time, we give up.\n\ |