* src/fns.c (Fcompare_strings): Use FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE.
[bpt/emacs.git] / lisp / select.el
index d3153a0..c4d0203 100644 (file)
@@ -1,8 +1,8 @@
 ;;; select.el --- lisp portion of standard selection support
 
-;; Copyright (C) 1993-1994, 2001-201 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1994, 2001-2014 Free Software Foundation, Inc.
 
-;; Maintainer: FSF
+;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: internal
 
 ;; This file is part of GNU Emacs.
@@ -89,7 +89,8 @@ all upper-case names.  The most often used ones, in addition to
 `PRIMARY', are `SECONDARY' and `CLIPBOARD'.
 
 DATA-TYPE is usually `STRING', but can also be one of the symbols
-in `selection-converter-alist', which see."
+in `selection-converter-alist', which see.  This argument is
+ignored on MS-Windows and MS-DOS."
   (let ((data (x-get-selection-internal (or type 'PRIMARY)
                                        (or data-type 'STRING)))
        coding)
@@ -248,7 +249,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))))))))