aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/international
diff options
context:
space:
mode:
authorKenichi Handa <[email protected]>2003-03-18 04:23:50 +0000
committerKenichi Handa <[email protected]>2003-03-18 04:23:50 +0000
commit6053d86a69a1cb1810cb417181236fee0f228d37 (patch)
treeff1fcbbfa6c3b0ff5f86f7e68ea93617129e5a6e /lisp/international
parent701117d5c676f42b2552132e6450b6651f980b8b (diff)
(find-coding-systems-for-charsets):
Use find-coding-systems-string instead of looking up char-coding-system-table.
Diffstat (limited to 'lisp/international')
-rw-r--r--lisp/international/mule-cmds.el31
1 files changed, 22 insertions, 9 deletions
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 3aa900fb32..82c9af3316 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -483,7 +483,10 @@ element `undecided'."
(defun find-coding-systems-for-charsets (charsets)
"Return a list of proper coding systems to encode characters of CHARSETS.
-CHARSETS is a list of character sets."
+CHARSETS is a list of character sets.
+It actually checks at most the first 96 characters of each charset.
+So, if a charset of dimension two is included in CHARSETS, the value may
+contain a coding system that can't encode all characters of the charset."
(cond ((or (null charsets)
(and (= (length charsets) 1)
(eq 'ascii (car charsets))))
@@ -493,21 +496,31 @@ CHARSETS is a list of character sets."
'(raw-text emacs-mule))
(t
(let ((codings t)
- charset l ll)
+ charset l str)
(while (and codings charsets)
(setq charset (car charsets) charsets (cdr charsets))
(unless (eq charset 'ascii)
- (setq l (aref char-coding-system-table (make-char charset)))
+ (setq str (make-string 96 32))
+ (if (= (charset-dimension charset) 1)
+ (if (= (charset-chars charset) 96)
+ (dotimes (i 96)
+ (aset str i (make-char charset (+ i 32))))
+ (dotimes (i 94)
+ (aset str i (make-char charset (+ i 33)))))
+ (if (= (charset-chars charset) 96)
+ (dotimes (i 96)
+ (aset str i (make-char charset 32 (+ i 32))))
+ (dotimes (i 94)
+ (aset str i (make-char charset 33 (+ i 33))))))
+ (setq l (find-coding-systems-string str))
(if (eq codings t)
(setq codings l)
(let ((ll nil))
- (while codings
- (if (memq (car codings) l)
- (setq ll (cons (car codings) ll)))
- (setq codings (cdr codings)))
+ (dolist (elt codings)
+ (if (memq elt l)
+ (setq ll (cons elt ll))))
(setq codings ll)))))
- (append codings
- (char-table-extra-slot char-coding-system-table 0))))))
+ codings))))
(defun find-multibyte-characters (from to &optional maxcount excludes)
"Find multibyte characters in the region specified by FROM and TO.