aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa1998-01-22 01:26:45 +0000
committerKenichi Handa1998-01-22 01:26:45 +0000
commit9391d06ab452fe8f54f97b5baa04d4a0c69f9b3f (patch)
tree2f772cda2aea2977cf38aa4fed7e5a7cd845685e /src
parentb3d8c659f57fa424722b295e658c369497a833b1 (diff)
downloademacs-9391d06ab452fe8f54f97b5baa04d4a0c69f9b3f.tar.gz
emacs-9391d06ab452fe8f54f97b5baa04d4a0c69f9b3f.zip
(selection_data_to_lisp_data): Adjusted for the change
of decode_coding. (lisp_data_to_selection_data): Adjusted for the change of encode_coding. (syms_of_xselect): Initialize clipboard-coding-system to compound-text.
Diffstat (limited to 'src')
-rw-r--r--src/xselect.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/xselect.c b/src/xselect.c
index 648d0607979..ec8d2af5388 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1493,20 +1493,21 @@ selection_data_to_lisp_data (display, data, size, type, format)
1493 } 1493 }
1494 } 1494 }
1495 if (!require_encoding) 1495 if (!require_encoding)
1496 str = make_string ((char *) data, size); 1496 str = make_unibyte_string ((char *) data, size);
1497 else 1497 else
1498 { 1498 {
1499 int bufsize, dummy; 1499 int bufsize;
1500 unsigned char *buf; 1500 unsigned char *buf;
1501 struct coding_system coding; 1501 struct coding_system coding;
1502 1502
1503 setup_coding_system 1503 setup_coding_system
1504 (Fcheck_coding_system(Vclipboard_coding_system), &coding); 1504 (Fcheck_coding_system(Vclipboard_coding_system), &coding);
1505 coding.last_block = 1; 1505 coding.mode |= CODING_MODE_LAST_BLOCK;
1506 bufsize = decoding_buffer_size (&coding, size); 1506 bufsize = decoding_buffer_size (&coding, size);
1507 buf = (unsigned char *) xmalloc (bufsize); 1507 buf = (unsigned char *) xmalloc (bufsize);
1508 size = decode_coding (&coding, data, buf, size, bufsize, &dummy); 1508 decode_coding (&coding, data, buf, size, bufsize);
1509 str = make_string ((char *) buf, size); 1509 str = make_multibyte_string ((char *) buf,
1510 coding.produced_char, coding.produced);
1510 xfree (buf); 1511 xfree (buf);
1511 } 1512 }
1512 return str; 1513 return str;
@@ -1630,17 +1631,17 @@ lisp_data_to_selection_data (display, obj,
1630 The format is compatible with what the target `STRING' 1631 The format is compatible with what the target `STRING'
1631 expects if OBJ contains only ASCII and Latin-1 1632 expects if OBJ contains only ASCII and Latin-1
1632 characters. */ 1633 characters. */
1633 int bufsize, dummy; 1634 int bufsize;
1634 unsigned char *buf; 1635 unsigned char *buf;
1635 struct coding_system coding; 1636 struct coding_system coding;
1636 1637
1637 setup_coding_system 1638 setup_coding_system
1638 (Fcheck_coding_system (Vclipboard_coding_system), &coding); 1639 (Fcheck_coding_system (Vclipboard_coding_system), &coding);
1639 coding.last_block = 1; 1640 coding.mode |= CODING_MODE_LAST_BLOCK;
1640 bufsize = encoding_buffer_size (&coding, *size_ret); 1641 bufsize = encoding_buffer_size (&coding, *size_ret);
1641 buf = (unsigned char *) xmalloc (bufsize); 1642 buf = (unsigned char *) xmalloc (bufsize);
1642 *size_ret = encode_coding (&coding, *data_ret, buf, 1643 encode_coding (&coding, *data_ret, buf, *size_ret, bufsize);
1643 *size_ret, bufsize, &dummy); 1644 *size_ret = coding.produced;
1644 *data_ret = buf; 1645 *data_ret = buf;
1645 if (charsets[charset_latin_iso8859_1] 1646 if (charsets[charset_latin_iso8859_1]
1646 && (num == 1 || (num == 2 && charsets[CHARSET_ASCII]))) 1647 && (num == 1 || (num == 2 && charsets[CHARSET_ASCII])))
@@ -2274,8 +2275,8 @@ it merely informs you that they have happened.");
2274 "Coding system for communicating with other X clients.\n\ 2275 "Coding system for communicating with other X clients.\n\
2275When sending or receiving text via cut_buffer, selection, and clipboard,\n\ 2276When sending or receiving text via cut_buffer, selection, and clipboard,\n\
2276the text is encoded or decoded by this coding system.\n\ 2277the text is encoded or decoded by this coding system.\n\
2277A default value is `iso-latin-1'"); 2278A default value is `compound-text'");
2278 Vclipboard_coding_system=intern ("iso-latin-1"); 2279 Vclipboard_coding_system=intern ("compound-text");
2279 staticpro(&Vclipboard_coding_system); 2280 staticpro(&Vclipboard_coding_system);
2280 2281
2281 DEFVAR_INT ("x-selection-timeout", &x_selection_timeout, 2282 DEFVAR_INT ("x-selection-timeout", &x_selection_timeout,