changeset 90353:6e94ff6be848

(ctext-non-standard-encodings-table): Reverse the returning list. (ctext-pre-write-conversion): Fix encoding with extended segments.
author Kenichi Handa <handa@m17n.org>
date Tue, 07 Mar 2006 04:13:56 +0000
parents 95ea8b972d57
children 450fb16a4bf4
files lisp/international/mule.el
diffstat 1 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/mule.el	Tue Mar 07 04:12:45 2006 +0000
+++ b/lisp/international/mule.el	Tue Mar 07 04:13:56 2006 +0000
@@ -1446,13 +1446,13 @@
 
 (defun ctext-non-standard-encodings-table ()
   (let (table)
-    ;; Setup charsets specified in `ctext-non-standard-encodings' and
-    ;; by the key `ctext-non-standard-encodings' for the current
-    ;; language environment.
+    ;; Setup charsets specified by the key
+    ;; `ctext-non-standard-encodings' for the current language
+    ;; environment and in `ctext-non-standard-encodings'.
     (dolist (encoding (append
-			ctext-non-standard-encodings
 			(get-language-info current-language-environment
-					   'ctext-non-standard-encodings)))
+					   'ctext-non-standard-encodings)
+			ctext-non-standard-encodings))
       (let* ((slot (assoc encoding ctext-non-standard-encodings-alist))
 	     (charset (nth 3 slot)))
 	(if (charsetp charset)
@@ -1469,7 +1469,11 @@
 		 (not (eq charset 'ascii))
 		 (not (string-match "cns11643" (symbol-name charset))))
 	    (push (cons charset nil) table))))
-    table))
+
+    ;; Returned reversed list so that the charsets specified by the
+    ;; key `ctext-non-standard-encodings' for the current language
+    ;; have the highest priority.
+    (nreverse table)))
 
 (defun ctext-pre-write-conversion (from to)
   "Encode characters between FROM and TO as Compound Text w/Extended Segments.
@@ -1528,7 +1532,8 @@
 			 (insert (format "\e%%/%d" noctets))
 			 (insert-byte (+ (/ len 128) 128) 1)
 			 (insert-byte (+ (% len 128) 128) 1)
-			 (insert encoding-name))))
+			 (insert encoding-name)
+			 (insert 2))))
 		    ((eq last-encoding-info 'utf-8)
 		     ;; Encode the previous range using UTF-8 encoding
 		     ;; extention.