comparison lisp/mule/general-late.el @ 4596:4fc32a3a086e

Fix a couple of bugs, #'query-coding-region, #'query-coding-string. 2009-02-04 Aidan Kehoe <kehoea@parhasard.net> * coding.el (query-coding-region): Revert this to being a defun, add a compiler macro without needless binding. (query-coding-string): Correct a bug here, string indices are zero- not one-based. * mule/general-late.el (unicode-query-coding-skip-chars-arg): Correct the algorithm used to initialise this variable.
author Aidan Kehoe <kehoea@parhasard.net>
date Wed, 04 Feb 2009 12:14:38 +0000
parents 84d618b355f5
children 257b468bf2ca
comparison
equal deleted inserted replaced
4595:a1a8728fec10 4596:4fc32a3a086e
69 ;; as binary. Ugh. 69 ;; as binary. Ugh.
70 system-type (symbol-value (intern "\u0073ystem-type")) 70 system-type (symbol-value (intern "\u0073ystem-type"))
71 71
72 unicode-query-coding-skip-chars-arg 72 unicode-query-coding-skip-chars-arg
73 (eval-when-compile 73 (eval-when-compile
74 (when-fboundp #'map-charset-chars 74 (when-fboundp 'map-charset-chars
75 (loop 75 (loop
76 for charset in (charset-list) 76 for charset in (charset-list)
77 with skip-chars-string = "" 77 with skip-chars-string = ""
78 do 78 do
79 (block no-ucs-mapping 79 (block no-ucs-mapping
80 (map-charset-chars 80 (map-charset-chars
81 #'(lambda (begin end) 81 #'(lambda (begin end)
82 (loop 82 (loop
83 while (/= end begin) 83 while (and begin (>= end begin))
84 do 84 do
85 (when (= -1 (char-to-unicode begin)) 85 (when (= -1 (char-to-unicode begin))
86 (setq this-charset-works nil)
87 (return-from no-ucs-mapping)) 86 (return-from no-ucs-mapping))
88 (setq begin (int-to-char (1+ begin))))) 87 (setq begin (int-to-char (1+ begin)))))
89 charset) 88 charset)
90 (setq skip-chars-string 89 (setq skip-chars-string
91 (concat skip-chars-string 90 (concat skip-chars-string
92 (charset-skip-chars-string charset)))) 91 (charset-skip-chars-string charset))))
93 finally return (skip-chars-quote skip-chars-string))))) 92 finally return skip-chars-string))))
94 93
95 ;; At this point in the dump, all the charsets have been loaded. Now, load 94 ;; At this point in the dump, all the charsets have been loaded. Now, load
96 ;; their Unicode mappings. 95 ;; their Unicode mappings.
97 (if load-unicode-tables-at-dump-time 96 (if load-unicode-tables-at-dump-time
98 (let ((data-directory (expand-file-name "etc" source-directory))) 97 (let ((data-directory (expand-file-name "etc" source-directory)))