]> git.eshelyaron.com Git - emacs.git/commitdiff
select.el (xselect--encode-string): If a coding is specified for selection, and that...
authorKenichi Handa <handa@gnu.org>
Wed, 10 Oct 2012 14:45:26 +0000 (23:45 +0900)
committerKenichi Handa <handa@gnu.org>
Wed, 10 Oct 2012 14:45:26 +0000 (23:45 +0900)
lisp/ChangeLog
lisp/select.el

index 59eba7a7d27a9d7b956e3f75c47f68312e931c26..69a03f2b170c4cf0198bbb29587ecbfffca5cc66 100644 (file)
@@ -1,3 +1,8 @@
+2012-10-10  Kenichi Handa  <handa@gnu.org>
+
+       * 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  <rudalics@gmx.at>
 
        * window.el (switch-to-buffer-preserve-window-point): New option.
index d3153a0ce0ed4672d38dd8b089c69ce86a4e2030..54520704261c16a9afa0ecae0d6edbc5ebede966 100644 (file)
@@ -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))))))))