aboutsummaryrefslogtreecommitdiffstats
path: root/src/xselect.c
diff options
context:
space:
mode:
authorKenichi Handa2002-03-01 04:28:00 +0000
committerKenichi Handa2002-03-01 04:28:00 +0000
commitc432b7991e44dcbafbf93fe85e37f043f9f34f12 (patch)
tree883a1da93304f8b2b568dccb4d87d8997346e2ef /src/xselect.c
parent6f33797458dbac56a1125c32e507eaefc1bc0f4b (diff)
downloademacs-c432b7991e44dcbafbf93fe85e37f043f9f34f12.tar.gz
emacs-c432b7991e44dcbafbf93fe85e37f043f9f34f12.zip
Don't include "charset.h".
(selection_data_to_lisp_data): Adjusted for the new code covnersion API.
Diffstat (limited to 'src/xselect.c')
-rw-r--r--src/xselect.c34
1 files changed, 13 insertions, 21 deletions
diff --git a/src/xselect.c b/src/xselect.c
index d21a978060f..a885ac9c546 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -29,7 +29,6 @@ Boston, MA 02111-1307, USA. */
29#include "frame.h" /* Need this to get the X window of selected_frame */ 29#include "frame.h" /* Need this to get the X window of selected_frame */
30#include "blockinput.h" 30#include "blockinput.h"
31#include "buffer.h" 31#include "buffer.h"
32#include "charset.h"
33#include "coding.h" 32#include "coding.h"
34#include "process.h" 33#include "process.h"
35#include "composite.h" 34#include "composite.h"
@@ -1634,29 +1633,22 @@ selection_data_to_lisp_data (display, data, size, type, format)
1634 } 1633 }
1635 else 1634 else
1636 { 1635 {
1637 int bufsize;
1638 unsigned char *buf;
1639 struct coding_system coding; 1636 struct coding_system coding;
1640 1637
1641 if (NILP (Vnext_selection_coding_system)) 1638 if (NILP (Vnext_selection_coding_system))
1642 Vnext_selection_coding_system = Vselection_coding_system; 1639 Vnext_selection_coding_system = Vselection_coding_system;
1643 setup_coding_system 1640 if (! CODING_SYSTEM_P (Vnext_selection_coding_system))
1644 (Fcheck_coding_system(Vnext_selection_coding_system), &coding); 1641 {
1645 coding.src_multibyte = 0; 1642 Vnext_selection_coding_system = Vselection_coding_system;
1646 coding.dst_multibyte = 1; 1643 if (! CODING_SYSTEM_P (Vnext_selection_coding_system))
1647 Vnext_selection_coding_system = Qnil; 1644 Vnext_selection_coding_system = Qraw_text;
1645 }
1646 setup_coding_system (Vnext_selection_coding_system, &coding);
1648 coding.mode |= CODING_MODE_LAST_BLOCK; 1647 coding.mode |= CODING_MODE_LAST_BLOCK;
1649 bufsize = decoding_buffer_size (&coding, size); 1648 decode_coding_c_string (&coding, data, size, Qt);
1650 buf = (unsigned char *) xmalloc (bufsize); 1649 str = coding.dst_object;
1651 decode_coding (&coding, data, buf, size, bufsize); 1650 Vlast_coding_system_used = Vnext_selection_coding_system;
1652 str = make_string_from_bytes ((char *) buf, 1651 Vnext_selection_coding_system = Qnil;
1653 coding.produced_char, coding.produced);
1654 xfree (buf);
1655
1656 if (SYMBOLP (coding.post_read_conversion)
1657 && !NILP (Ffboundp (coding.post_read_conversion)))
1658 str = run_pre_post_conversion_on_str (str, &coding, 0);
1659 Vlast_coding_system_used = coding.symbol;
1660 } 1652 }
1661 compose_chars_in_text (0, XSTRING (str)->size, str); 1653 compose_chars_in_text (0, XSTRING (str)->size, str);
1662 return str; 1654 return str;