comparison lisp/term/mac-win.el @ 62291:461736030d14

(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'.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Fri, 13 May 2005 08:51:35 +0000
parents eaa9acd9122c
children a7e02ef1e3d6
comparison
equal deleted inserted replaced
62290:19e0ad492c07 62291:461736030d14
1326 (setq s (mac-code-convert-string 1326 (setq s (mac-code-convert-string
1327 (encode-coding-string str coding) 1327 (encode-coding-string str coding)
1328 coding 'utf-16))) 1328 coding 'utf-16)))
1329 (setq str (or s (encode-coding-string str 'utf-16-mac))))) 1329 (setq str (or s (encode-coding-string str 'utf-16-mac)))))
1330 ((eq type 'com.apple.traditional-mac-plain-text) 1330 ((eq type 'com.apple.traditional-mac-plain-text)
1331 (let ((encodables (find-coding-systems-string str))
1332 (rest mac-script-code-coding-systems))
1333 (unless (memq coding encodables)
1334 (while (and rest (not (memq (cdar rest) encodables)))
1335 (setq rest (cdr rest)))
1336 (if rest
1337 (setq coding (cdar rest)))))
1331 (setq coding (coding-system-change-eol-conversion coding 'mac)) 1338 (setq coding (coding-system-change-eol-conversion coding 'mac))
1332 (setq str (encode-coding-string str coding))) 1339 (setq str (encode-coding-string str coding)))
1333 (t 1340 (t
1334 (error "Unknown selection type: %S" type)) 1341 (error "Unknown selection type: %S" type))
1335 ))) 1342 )))