From 4ef4a10d1c513bb3b009c29872d0dc621eb826ce Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 10 Oct 2012 23:45:26 +0900 Subject: [PATCH] select.el (xselect--encode-string): If a coding is specified for selection, and that is compatible with COMPOUND_TEXT, use it. --- lisp/ChangeLog | 5 +++++ lisp/select.el | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 59eba7a7d27..69a03f2b170 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-10-10 Kenichi Handa + + * select.el (xselect--encode-string): If a coding is specified for + selection, and that is compatible with COMPOUND_TEXT, use it. + 2012-10-10 Martin Rudalics * window.el (switch-to-buffer-preserve-window-point): New option. diff --git a/lisp/select.el b/lisp/select.el index d3153a0ce0e..54520704261 100644 --- a/lisp/select.el +++ b/lisp/select.el @@ -248,7 +248,17 @@ two markers or an overlay. Otherwise, it is nil." (setq non-unicode t) (setq eight-bit t))))) str) - (setq type (if non-unicode 'COMPOUND_TEXT + (setq type (if (or non-unicode + (and + non-latin-1 + ;; If a coding is specified for + ;; selection, and that is + ;; compatible with COMPOUND_TEXT, + ;; use it. + coding + (eq (coding-system-get coding :mime-charset) + 'x-ctext))) + 'COMPOUND_TEXT (if non-latin-1 'UTF8_STRING (if eight-bit 'C_STRING 'STRING)))))))) -- 2.39.2