summaryrefslogtreecommitdiff
path: root/src/xselect.c
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>1998-01-22 01:26:45 +0000
committerKenichi Handa <handa@m17n.org>1998-01-22 01:26:45 +0000
commit9391d06ab452fe8f54f97b5baa04d4a0c69f9b3f (patch)
tree2f772cda2aea2977cf38aa4fed7e5a7cd845685e /src/xselect.c
parentb3d8c659f57fa424722b295e658c369497a833b1 (diff)
downloademacs-9391d06ab452fe8f54f97b5baa04d4a0c69f9b3f.tar.gz
emacs-9391d06ab452fe8f54f97b5baa04d4a0c69f9b3f.tar.bz2
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/xselect.c')
-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)
}
}
if (!require_encoding)
- str = make_string ((char *) data, size);
+ str = make_unibyte_string ((char *) data, size);
else
{
- int bufsize, dummy;
+ int bufsize;
unsigned char *buf;
struct coding_system coding;
setup_coding_system
(Fcheck_coding_system(Vclipboard_coding_system), &coding);
- coding.last_block = 1;
+ coding.mode |= CODING_MODE_LAST_BLOCK;
bufsize = decoding_buffer_size (&coding, size);
buf = (unsigned char *) xmalloc (bufsize);
- size = decode_coding (&coding, data, buf, size, bufsize, &dummy);
- str = make_string ((char *) buf, size);
+ decode_coding (&coding, data, buf, size, bufsize);
+ str = make_multibyte_string ((char *) buf,
+ coding.produced_char, coding.produced);
xfree (buf);
}
return str;
@@ -1630,17 +1631,17 @@ lisp_data_to_selection_data (display, obj,
The format is compatible with what the target `STRING'
expects if OBJ contains only ASCII and Latin-1
characters. */
- int bufsize, dummy;
+ int bufsize;
unsigned char *buf;
struct coding_system coding;
setup_coding_system
(Fcheck_coding_system (Vclipboard_coding_system), &coding);
- coding.last_block = 1;
+ coding.mode |= CODING_MODE_LAST_BLOCK;
bufsize = encoding_buffer_size (&coding, *size_ret);
buf = (unsigned char *) xmalloc (bufsize);
- *size_ret = encode_coding (&coding, *data_ret, buf,
- *size_ret, bufsize, &dummy);
+ encode_coding (&coding, *data_ret, buf, *size_ret, bufsize);
+ *size_ret = coding.produced;
*data_ret = buf;
if (charsets[charset_latin_iso8859_1]
&& (num == 1 || (num == 2 && charsets[CHARSET_ASCII])))
@@ -2274,8 +2275,8 @@ it merely informs you that they have happened.");
"Coding system for communicating with other X clients.\n\
When sending or receiving text via cut_buffer, selection, and clipboard,\n\
the text is encoded or decoded by this coding system.\n\
-A default value is `iso-latin-1'");
- Vclipboard_coding_system=intern ("iso-latin-1");
+A default value is `compound-text'");
+ Vclipboard_coding_system=intern ("compound-text");
staticpro(&Vclipboard_coding_system);
DEFVAR_INT ("x-selection-timeout", &x_selection_timeout,