summaryrefslogtreecommitdiff
path: root/lisp/term
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>2005-05-13 08:51:35 +0000
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>2005-05-13 08:51:35 +0000
commit5a537870e39b4caf1dccc69c07b499ed9a69f8de (patch)
tree9aeab5a9a70b2233d695b4da741213c7947a5b71 /lisp/term
parent66b8e07b28ba264dddbe36a036225879c8d8b4a1 (diff)
downloademacs-5a537870e39b4caf1dccc69c07b499ed9a69f8de.tar.gz
(mac-select-convert-to-string): Try coding
systems in mac-script-code-coding-systems if specified one cannot encode string for `com.apple.traditional-mac-plain-text'.
Diffstat (limited to 'lisp/term')
-rw-r--r--lisp/term/mac-win.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index 8fbbc7cd41a..366668c66f3 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -1328,6 +1328,13 @@ in `selection-converter-alist', which see."
coding 'utf-16)))
(setq str (or s (encode-coding-string str 'utf-16-mac)))))
((eq type 'com.apple.traditional-mac-plain-text)
+ (let ((encodables (find-coding-systems-string str))
+ (rest mac-script-code-coding-systems))
+ (unless (memq coding encodables)
+ (while (and rest (not (memq (cdar rest) encodables)))
+ (setq rest (cdr rest)))
+ (if rest
+ (setq coding (cdar rest)))))
(setq coding (coding-system-change-eol-conversion coding 'mac))
(setq str (encode-coding-string str coding)))
(t