emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r107961: * select.el (xselect--enc


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r107961: * select.el (xselect--encode-string): Always use utf-8 for TEXT on Nextstep.
Date: Fri, 04 May 2012 18:23:00 +0800
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107961
committer: Chong Yidong <address@hidden>
branch nick: emacs-24
timestamp: Fri 2012-05-04 18:23:00 +0800
message:
  * select.el (xselect--encode-string): Always use utf-8 for TEXT on Nextstep.
modified:
  lisp/ChangeLog
  lisp/select.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-04-30 12:50:12 +0000
+++ b/lisp/ChangeLog    2012-05-04 10:23:00 +0000
@@ -1,3 +1,8 @@
+2012-05-04  Chong Yidong  <address@hidden>
+
+       * select.el (xselect--encode-string): Always use utf-8 for TEXT on
+       Nextstep.
+
 2012-04-30  Eli Zaretskii  <address@hidden>
 
        * mail/rmail.el (rmail-yank-current-message): Use the encoding of

=== modified file 'lisp/select.el'
--- a/lisp/select.el    2012-04-24 05:34:50 +0000
+++ b/lisp/select.el    2012-05-04 10:23:00 +0000
@@ -228,24 +228,30 @@
          ;; But avoid modifying the string if it's a buffer name etc.
          (unless can-modify (setq str (substring str 0)))
          (remove-text-properties 0 (length str) '(composition nil) str)
-         ;; TEXT is a polymorphic target.  Select the actual type
-         ;; from `UTF8_STRING', `COMPOUND_TEXT', `STRING', and
-         ;; `C_STRING'.
-         (if (eq type 'TEXT)
-             (if (not (multibyte-string-p str))
-                 (setq type 'C_STRING)
-               (let (non-latin-1 non-unicode eight-bit)
-                 (mapc #'(lambda (x)
-                           (if (>= x #x100)
-                               (if (< x #x110000)
-                                   (setq non-latin-1 t)
-                                 (if (< x #x3FFF80)
-                                     (setq non-unicode t)
-                                   (setq eight-bit t)))))
-                       str)
-                 (setq type (if non-unicode 'COMPOUND_TEXT
-                              (if non-latin-1 'UTF8_STRING
-                                (if eight-bit 'C_STRING 'STRING)))))))
+         ;; For X selections, TEXT is a polymorphic target; choose
+         ;; the actual type from `UTF8_STRING', `COMPOUND_TEXT',
+         ;; `STRING', and `C_STRING'.  On Nextstep, always use UTF-8
+         ;; (see ns_string_to_pasteboard_internal in nsselect.m).
+         (when (eq type 'TEXT)
+           (cond
+            ((featurep 'ns)
+             (setq type 'UTF8_STRING))
+            ((not (multibyte-string-p str))
+             (setq type 'C_STRING))
+            (t
+             (let (non-latin-1 non-unicode eight-bit)
+               (mapc #'(lambda (x)
+                         (if (>= x #x100)
+                             (if (< x #x110000)
+                                 (setq non-latin-1 t)
+                               (if (< x #x3FFF80)
+                                   (setq non-unicode t)
+                                 (setq eight-bit t)))))
+                     str)
+               (setq type (if non-unicode 'COMPOUND_TEXT
+                            (if non-latin-1 'UTF8_STRING
+                              (if eight-bit 'C_STRING
+                                'STRING))))))))
          (cond
           ((eq type 'UTF8_STRING)
            (if (or (not coding)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]