aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2012-05-04 18:23:00 +0800
committerChong Yidong2012-05-04 18:23:00 +0800
commitf16e53860f281bc6677c2835d5b0225831a41739 (patch)
treedf7eba133ad762082774b1e1c2f1e98d63b3d17f
parent8d8d67aee8c9a21269ff2d5185daead8ce495072 (diff)
downloademacs-f16e53860f281bc6677c2835d5b0225831a41739.tar.gz
emacs-f16e53860f281bc6677c2835d5b0225831a41739.zip
* select.el (xselect--encode-string): Always use utf-8 for TEXT on Nextstep.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/select.el42
2 files changed, 29 insertions, 18 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ae273d9d610..dbbb2fb4c76 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12012-05-04 Chong Yidong <cyd@gnu.org>
2
3 * select.el (xselect--encode-string): Always use utf-8 for TEXT on
4 Nextstep.
5
12012-04-30 Eli Zaretskii <eliz@gnu.org> 62012-04-30 Eli Zaretskii <eliz@gnu.org>
2 7
3 * mail/rmail.el (rmail-yank-current-message): Use the encoding of 8 * mail/rmail.el (rmail-yank-current-message): Use the encoding of
diff --git a/lisp/select.el b/lisp/select.el
index 3948fcc5456..d3153a0ce0e 100644
--- a/lisp/select.el
+++ b/lisp/select.el
@@ -228,24 +228,30 @@ two markers or an overlay. Otherwise, it is nil."
228 ;; But avoid modifying the string if it's a buffer name etc. 228 ;; But avoid modifying the string if it's a buffer name etc.
229 (unless can-modify (setq str (substring str 0))) 229 (unless can-modify (setq str (substring str 0)))
230 (remove-text-properties 0 (length str) '(composition nil) str) 230 (remove-text-properties 0 (length str) '(composition nil) str)
231 ;; TEXT is a polymorphic target. Select the actual type 231 ;; For X selections, TEXT is a polymorphic target; choose
232 ;; from `UTF8_STRING', `COMPOUND_TEXT', `STRING', and 232 ;; the actual type from `UTF8_STRING', `COMPOUND_TEXT',
233 ;; `C_STRING'. 233 ;; `STRING', and `C_STRING'. On Nextstep, always use UTF-8
234 (if (eq type 'TEXT) 234 ;; (see ns_string_to_pasteboard_internal in nsselect.m).
235 (if (not (multibyte-string-p str)) 235 (when (eq type 'TEXT)
236 (setq type 'C_STRING) 236 (cond
237 (let (non-latin-1 non-unicode eight-bit) 237 ((featurep 'ns)
238 (mapc #'(lambda (x) 238 (setq type 'UTF8_STRING))
239 (if (>= x #x100) 239 ((not (multibyte-string-p str))
240 (if (< x #x110000) 240 (setq type 'C_STRING))
241 (setq non-latin-1 t) 241 (t
242 (if (< x #x3FFF80) 242 (let (non-latin-1 non-unicode eight-bit)
243 (setq non-unicode t) 243 (mapc #'(lambda (x)
244 (setq eight-bit t))))) 244 (if (>= x #x100)
245 str) 245 (if (< x #x110000)
246 (setq type (if non-unicode 'COMPOUND_TEXT 246 (setq non-latin-1 t)
247 (if non-latin-1 'UTF8_STRING 247 (if (< x #x3FFF80)
248 (if eight-bit 'C_STRING 'STRING))))))) 248 (setq non-unicode t)
249 (setq eight-bit t)))))
250 str)
251 (setq type (if non-unicode 'COMPOUND_TEXT
252 (if non-latin-1 'UTF8_STRING
253 (if eight-bit 'C_STRING
254 'STRING))))))))
249 (cond 255 (cond
250 ((eq type 'UTF8_STRING) 256 ((eq type 'UTF8_STRING)
251 (if (or (not coding) 257 (if (or (not coding)