Mercurial > hg > xemacs-beta
annotate lisp/mule/mule-charset.el @ 5549:493c487cbc3f
Add #'event-apply-modifiers, implement #'event-apply-modifiers in terms of it.
2011-08-10 Aidan Kehoe <kehoea@parhasard.net>
* keymap.el:
* keymap.el (event-apply-alt-modifier):
* keymap.el (event-apply-super-modifier):
* keymap.el (event-apply-hyper-modifier):
* keymap.el (event-apply-shift-modifier):
* keymap.el (event-apply-control-modifier):
* keymap.el (event-apply-meta-modifier):
* keymap.el (event-apply-modifiers): New.
* keymap.el (event-apply-modifier): Implement in terms of
#'event-apply-modifier.
Rework #'event-apply-modifier to take a list of modifiers, and
change its name appropriately. Keep the old name around, too.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Wed, 10 Aug 2011 16:50:37 +0100 |
parents | 308d34e9f07d |
children |
rev | line source |
---|---|
502 | 1 ;;; mule-charset.el --- Charset functions for Mule. -*- coding: iso-2022-7bit; -*- |
428 | 2 |
788 | 3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. |
4 ;; Copyright (C) 1992, 2001 Free Software Foundation, Inc. | |
5 ;; Licensed to the Free Software Foundation. | |
428 | 6 ;; Copyright (C) 1995 Amdahl Corporation. |
7 ;; Copyright (C) 1996 Sun Microsystems. | |
777 | 8 ;; Copyright (C) 2002 Ben Wing. |
428 | 9 |
10 ;; Author: Unknown | |
11 ;; Keywords: i18n, mule, internal | |
12 | |
13 ;; This file is part of XEmacs. | |
14 | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
4549
diff
changeset
|
15 ;; XEmacs is free software: you can redistribute it and/or modify it |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
4549
diff
changeset
|
16 ;; under the terms of the GNU General Public License as published by the |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
4549
diff
changeset
|
17 ;; Free Software Foundation, either version 3 of the License, or (at your |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
4549
diff
changeset
|
18 ;; option) any later version. |
428 | 19 |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
4549
diff
changeset
|
20 ;; XEmacs is distributed in the hope that it will be useful, but WITHOUT |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
4549
diff
changeset
|
21 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
4549
diff
changeset
|
22 ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
4549
diff
changeset
|
23 ;; for more details. |
428 | 24 |
25 ;; You should have received a copy of the GNU General Public License | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
4549
diff
changeset
|
26 ;; along with XEmacs. If not, see <http://www.gnu.org/licenses/>. |
428 | 27 |
28 ;;; Synched up with: Not synched. API at source level synched with FSF 20.3.9. | |
29 | |
30 ;;; Commentary: | |
31 | |
32 ;; These functions are not compatible at the bytecode level with Emacs/Mule, | |
33 ;; and they never will be. -sb [1999-05-26] | |
34 | |
35 ;;; Code: | |
36 | |
37 ;;;; Classifying text according to charsets | |
38 | |
39 (defun charsets-in-string (string) | |
40 "Return a list of the charsets in STRING." | |
3681 | 41 (let (res) |
42 (with-string-as-buffer-contents string | |
43 ;; charsets-in-region now in C. | |
44 (setq res (charsets-in-region (point-min) (point-max)))) | |
45 res)) | |
428 | 46 |
771 | 47 (defalias 'find-charset-string 'charsets-in-string) |
3681 | 48 |
771 | 49 (defalias 'find-charset-region 'charsets-in-region) |
818 | 50 |
428 | 51 |
52 ;;;; Charset accessors | |
53 | |
54 (defun charset-iso-graphic-plane (charset) | |
55 "Return the `graphic' property of CHARSET. | |
56 See `make-charset'." | |
57 (charset-property charset 'graphic)) | |
58 | |
59 (defun charset-iso-final-char (charset) | |
60 "Return the final byte of the ISO 2022 escape sequence designating CHARSET." | |
61 (charset-property charset 'final)) | |
62 | |
63 (defun charset-chars (charset) | |
64 "Return the number of characters per dimension of CHARSET." | |
65 (charset-property charset 'chars)) | |
66 | |
67 (defun charset-width (charset) | |
68 "Return the number of display columns per character of CHARSET. | |
69 This only applies to TTY mode (under X, the actual display width can | |
70 be automatically determined)." | |
71 (charset-property charset 'columns)) | |
72 | |
73 ;; #### FSFmacs returns 0 | |
74 (defun charset-direction (charset) | |
75 "Return the display direction (0 for `l2r' or 1 for `r2l') of CHARSET. | |
76 Only left-to-right is currently implemented." | |
77 (if (eq (charset-property charset 'direction) 'l2r) | |
78 0 | |
79 1)) | |
80 | |
3659 | 81 ;; Not in GNU Emacs/Mule |
428 | 82 (defun charset-registry (charset) |
3712 | 83 "Obsolete; use charset-registries instead. " |
3659 | 84 (lwarn 'xintl 'warning |
85 "charset-registry is obsolete--use charset-registries instead. ") | |
86 (when (charset-property charset 'registries) | |
87 (elt (charset-property charset 'registries) 0))) | |
88 | |
3712 | 89 (make-obsolete 'charset-registry 'charset-registries) |
90 | |
3659 | 91 (defun charset-registries (charset) |
92 "Return the registries of CHARSET." | |
93 (charset-property charset 'registries)) | |
94 | |
95 (defun set-charset-registry (charset registry) | |
96 "Obsolete; use set-charset-registries instead. " | |
97 (check-argument-type 'stringp registry) | |
98 (check-argument-type 'charsetp (find-charset charset)) | |
99 (unless (equal registry (regexp-quote registry)) | |
100 (lwarn 'xintl 'warning | |
101 "Regexps no longer allowed for charset-registry. Treating %s%s" | |
102 registry " as a string.")) | |
103 (set-charset-registries | |
104 charset | |
105 (apply 'vector registry (append (charset-registries charset) nil)))) | |
428 | 106 |
3712 | 107 (make-obsolete 'set-charset-registry 'set-charset-registries) |
108 | |
428 | 109 (defun charset-ccl-program (charset) |
110 "Return the CCL program of CHARSET. | |
111 See `make-charset'." | |
112 (charset-property charset 'ccl-program)) | |
113 | |
114 (defun charset-bytes (charset) | |
115 "Useless in XEmacs, returns 1." | |
116 1) | |
117 | |
4549
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
118 (defun charset-skip-chars-string (charset) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
119 "Given CHARSET, return a string suitable for for `skip-chars-forward'. |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
120 Passing the string to `skip-chars-forward' will cause it to skip all |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
121 characters in CHARSET." |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
122 (setq charset (get-charset charset)) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
123 (cond |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
124 ;; Aargh, the general algorithm doesn't work for these charsets, because |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
125 ;; make-char strips the high bit. Hard code them. |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
126 ((eq (find-charset 'ascii) charset) "\x00-\x7f") |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
127 ((eq (find-charset 'control-1) charset) "\x80-\x9f") |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
128 (t |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
129 (let (charset-lower charset-upper row-upper row-lower) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
130 (if (= 1 (charset-dimension charset)) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
131 (condition-case args-out-of-range |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
132 (make-char charset #x100) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
133 (args-out-of-range |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
134 (setq charset-lower (third args-out-of-range) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
135 charset-upper (fourth args-out-of-range)) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
136 (format "%c-%c" |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
137 (make-char charset charset-lower) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
138 (make-char charset charset-upper)))) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
139 (condition-case args-out-of-range |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
140 (make-char charset #x100 #x22) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
141 (args-out-of-range |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
142 (setq row-lower (third args-out-of-range) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
143 row-upper (fourth args-out-of-range)))) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
144 (condition-case args-out-of-range |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
145 (make-char charset #x22 #x100) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
146 (args-out-of-range |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
147 (setq charset-lower (third args-out-of-range) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
148 charset-upper (fourth args-out-of-range)))) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
149 (format "%c-%c" |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
150 (make-char charset row-lower charset-lower) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
151 (make-char charset row-upper charset-upper))))))) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
152 ;; From GNU. |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
153 (defun map-charset-chars (func charset) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
154 "Use FUNC to map over all characters in CHARSET for side effects. |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
155 FUNC is a function of two args, the start and end (inclusive) of a |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
156 character code range. Thus FUNC should iterate over [START, END]." |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
157 (check-argument-type #'functionp func) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
158 (check-argument-type #'charsetp (setq charset (find-charset charset))) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
159 (let* ((dim (charset-dimension charset)) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
160 (chars (charset-chars charset)) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
161 (start (if (= chars 94) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
162 33 |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
163 32))) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
164 (if (= dim 1) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
165 (cond |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
166 ((eq (find-charset 'ascii) charset) (funcall func ?\x00 ?\x7f)) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
167 ((eq (find-charset 'control-1) charset) (funcall func ?\x80 ?\x9f)) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
168 (t |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
169 (funcall func |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
170 (make-char charset start) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
171 (make-char charset (+ start chars -1))))) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
172 (dotimes (i chars) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
173 (funcall func |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
174 (make-char charset (+ i start) start) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
175 (make-char charset (+ i start) (+ start chars -1))))))) |
68d1ca56cffa
First part of interactive checks that coding systems encode regions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4072
diff
changeset
|
176 |
428 | 177 ;;;; Define setf methods for all settable Charset properties |
178 | |
179 (defsetf charset-registry set-charset-registry) | |
180 (defsetf charset-ccl-program set-charset-ccl-program) | |
3712 | 181 (defsetf charset-registries set-charset-registries) |
428 | 182 |
183 ;;; FSF compatibility functions | |
184 (defun charset-after (&optional pos) | |
185 "Return charset of a character in current buffer at position POS. | |
186 If POS is nil, it defauls to the current point. | |
187 If POS is out of range, the value is nil." | |
188 (when (null pos) | |
189 (setq pos (point))) | |
190 (check-argument-type 'integerp pos) | |
191 (unless (or (< pos (point-min)) | |
192 (> pos (point-max))) | |
193 (char-charset (char-after pos)))) | |
194 | |
195 ;; Yuck! | |
771 | 196 ;; We're not going to support these. |
197 ;(defun charset-info (charset) [incredibly broken function with random vectors] | |
198 ;(defun define-charset (...) [incredibly broken function with random vectors] | |
428 | 199 |
200 ;;; Charset property | |
201 | |
202 (defalias 'get-charset-property 'get) | |
203 (defalias 'put-charset-property 'put) | |
204 (defalias 'charset-plist 'object-plist) | |
205 (defalias 'set-charset-plist 'setplist) | |
206 | |
771 | 207 |
788 | 208 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
209 ; translation tables ; | |
210 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
211 | |
212 (defstruct (translation-table (:constructor internal-make-translation-table)) | |
213 forward | |
214 reverse) | |
215 | |
216 (defun make-translation-table (&rest args) | |
217 "Make a translation table from arguments. | |
2116 | 218 A translation table is a char table intended for character translation |
219 in CCL programs. | |
788 | 220 |
221 Each argument is a list of elemnts of the form (FROM . TO), where FROM | |
222 is a character to be translated to TO. | |
223 | |
224 FROM can be a generic character (see `make-char'). In this case, TO is | |
225 a generic character containing the same number of characters, or a | |
226 ordinary character. If FROM and TO are both generic characters, all | |
227 characters belonging to FROM are translated to characters belonging to TO | |
228 without changing their position code(s). | |
229 | |
230 The arguments and forms in each argument are processed in the given | |
231 order, and if a previous form already translates TO to some other | |
232 character, say TO-ALT, FROM is also translated to TO-ALT." | |
233 (let ((table (internal-make-translation-table | |
234 :forward (make-char-table 'generic))) | |
235 revlist) | |
236 (while args | |
237 (let ((elts (car args))) | |
238 (while elts | |
239 (let* ((from (car (car elts))) | |
240 (from-i 0) ; degree of freedom of FROM | |
241 (from-rev (nreverse (split-char from))) | |
242 (to (cdr (car elts))) | |
243 (to-i 0) ; degree of freedom of TO | |
244 (to-rev (nreverse (split-char to)))) | |
245 ;; Check numbers of heading 0s in FROM-REV and TO-REV. | |
246 (while (eq (car from-rev) 0) | |
247 (setq from-i (1+ from-i) from-rev (cdr from-rev))) | |
248 (while (eq (car to-rev) 0) | |
249 (setq to-i (1+ to-i) to-rev (cdr to-rev))) | |
250 (if (and (/= from-i to-i) (/= to-i 0)) | |
251 (error "Invalid character pair (%d . %d)" from to)) | |
252 ;; If we have already translated TO to TO-ALT, FROM should | |
253 ;; also be translated to TO-ALT. But, this is only if TO | |
254 ;; is a generic character or TO-ALT is not a generic | |
255 ;; character. | |
256 (let ((to-alt (get-char-table to table))) | |
257 (if (and to-alt | |
258 (or (> to-i 0) (not (find-charset to-alt)))) | |
259 (setq to to-alt))) | |
260 (if (> from-i 0) | |
261 (set-char-table-default table from to) | |
262 (put-char-table from to table)) | |
263 ;; If we have already translated some chars to FROM, they | |
264 ;; should also be translated to TO. | |
265 (let ((l (assq from revlist))) | |
266 (if l | |
267 (let ((ch (car l))) | |
268 (setcar l to) | |
269 (setq l (cdr l)) | |
270 (while l | |
271 (put-char-table ch to table) | |
272 (setq l (cdr l)) )))) | |
273 ;; Now update REVLIST. | |
274 (let ((l (assq to revlist))) | |
275 (if l | |
276 (setcdr l (cons from (cdr l))) | |
277 (setq revlist (cons (list to from) revlist))))) | |
278 (setq elts (cdr elts)))) | |
279 (setq args (cdr args))) | |
280 ;; Return TABLE just created. | |
281 table)) | |
282 | |
283 ;; Do we really need this? | |
284 ; (defun make-translation-table-from-vector (vec) | |
285 ; "Make translation table from decoding vector VEC. | |
286 ; VEC is an array of 256 elements to map unibyte codes to multibyte characters. | |
287 ; See also the variable `nonascii-translation-table'." | |
288 ; (let ((table (make-char-table 'translation-table)) | |
289 ; (rev-table (make-char-table 'translation-table)) | |
290 ; (i 0) | |
291 ; ch) | |
292 ; (while (< i 256) | |
293 ; (setq ch (aref vec i)) | |
294 ; (aset table i ch) | |
295 ; (if (>= ch 256) | |
296 ; (aset rev-table ch i)) | |
297 ; (setq i (1+ i))) | |
298 ; (set-char-table-extra-slot table 0 rev-table) | |
299 ; table)) | |
300 | |
301 (defvar named-translation-table-hash-table (make-hash-table)) | |
302 | |
303 (defun define-translation-table (symbol &rest args) | |
304 "Define SYMBOL as the name of translation table made by ARGS. | |
305 This sets up information so that the table can be used for | |
306 translations in a CCL program. | |
307 | |
308 If the first element of ARGS is a translation table, just define SYMBOL to | |
309 name it. (Note that this function does not bind SYMBOL.) | |
310 | |
311 Any other ARGS should be suitable as arguments of the function | |
312 `make-translation-table' (which see). | |
313 | |
314 Look up a named translation table using `find-translation-table' or | |
315 `get-translation-table'." | |
316 (let ((table (if (translation-table-p (car args)) | |
317 (car args) | |
318 (apply 'make-translation-table args)))) | |
319 (puthash symbol table named-translation-table-hash-table))) | |
320 | |
321 (defun find-translation-table (table-or-name) | |
322 "Retrieve the translation table of the given name. | |
323 If TABLE-OR-NAME is a translation table object, it is simply returned. | |
324 Otherwise, TABLE-OR-NAME should be a symbol. If there is no such | |
325 translation table, nil is returned. Otherwise the associated translation | |
326 table object is returned." | |
327 (if (translation-table-p table-or-name) | |
328 table-or-name | |
329 (check-argument-type 'symbolp table-or-name) | |
330 (gethash table-or-name named-translation-table-hash-table))) | |
331 | |
332 (defun get-translation-table (table-or-name) | |
333 "Retrieve the translation table of the given name. | |
334 Same as `find-translation-table' except an error is signalled if there is | |
335 no such translation table instead of returning nil." | |
336 (or (find-translation-table table-or-name) | |
337 (error 'invalid-argument "No such translation table" table-or-name))) | |
338 | |
339 | |
442 | 340 ;; Setup auto-fill-chars for charsets that should invoke auto-filling. |
777 | 341 ;; SPACE and NEWLINE are already set. |
442 | 342 (let ((l '(katakana-jisx0201 |
343 japanese-jisx0208 japanese-jisx0212 | |
344 chinese-gb2312 chinese-big5-1 chinese-big5-2))) | |
345 (while l | |
346 (put-char-table (car l) t auto-fill-chars) | |
347 (setq l (cdr l)))) | |
348 | |
778 | 349 |
350 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
351 ; charsets ; | |
352 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
353 | |
354 ;; Synched up with: FSF 21.1. | |
355 | |
356 ;; All FSF charset definitions are in mule-conf.el. I copied the relevant | |
357 ;; part of that file below, then converted all charset definitions using | |
358 ;; the macro below, then globally replaced 'direction 0' with 'direction | |
359 ;; l2r' and 'direction 1' with 'direction r2l', then commented everything | |
360 ;; out. Copy the definitions as necessary to individual files. | |
361 | |
362 ;; Kbd macro to convert from FSF-style define-charset to our make-charset. | |
363 | |
364 ; (setq last-kbd-macro (read-kbd-macro | |
365 ; "<right> M-d make <M-right> M-d <home> <down> TAB '[dimension DEL SPC <M-right> RET TAB chars SPC <M-right> RET TAB columns SPC <M-right> RET TAB direction SPC <M-right> RET TAB final SPC <M-right> RET TAB graphic SPC <M-right> RET TAB short- name SPC <M-right> RET TAB long- name SPC <M-right> RET TAB <S-M-right> <f2> DEL TAB <end> ] <M-left> <end> SPC <f4> 3*<M-left> <left> <M-right> RET <down>")) | |
366 | |
367 ;; Kbd macro to take one registry entry from the list of registry entries, | |
368 ;; find the appropriate make-charset call, and add the appropriate registry | |
369 ;; property. | |
370 | |
371 ; (setq last-kbd-macro (read-kbd-macro | |
372 ; "3*<right> <S-M-right> C-x x 1 <right> <S-M-right> C-x x 2 <home> C-x r m foo RET <M-down> M-x sear TAB for TAB RET C-x g 1 RET C-s dimen RET <end> RET TAB 3*<backspace> registry SPC C-x g 2 C-x r b RET <down>")) | |
373 | |
374 ;; List from FSF international/fontset.el of registries for charsets. | |
375 | |
376 ;; latin-iso8859-1 "ISO8859-1" | |
377 ;; latin-iso8859-2 "ISO8859-2" | |
378 ;; latin-iso8859-3 "ISO8859-3" | |
379 ;; latin-iso8859-4 "ISO8859-4" | |
380 ;; thai-tis620 "TIS620" | |
381 ;; greek-iso8859-7 "ISO8859-7" | |
382 ;; arabic-iso8859-6 "ISO8859-6" | |
383 ;; hebrew-iso8859-8 "ISO8859-8" | |
384 ;; katakana-jisx0201 "JISX0201" | |
385 ;; latin-jisx0201 "JISX0201" | |
386 ;; cyrillic-iso8859-5 "ISO8859-5" | |
387 ;; latin-iso8859-9 "ISO8859-9" | |
388 ;; japanese-jisx0208-1978 "JISX0208.1978" | |
389 ;; chinese-gb2312 "GB2312.1980" | |
390 ;; japanese-jisx0208 "JISX0208.1990" | |
391 ;; korean-ksc5601 "KSC5601.1989" | |
392 ;; japanese-jisx0212 "JISX0212" | |
393 ;; chinese-cns11643-1 "CNS11643.1992-1" | |
394 ;; chinese-cns11643-2 "CNS11643.1992-2" | |
395 ;; chinese-cns11643-3 "CNS11643.1992-3" | |
396 ;; chinese-cns11643-4 "CNS11643.1992-4" | |
397 ;; chinese-cns11643-5 "CNS11643.1992-5" | |
398 ;; chinese-cns11643-6 "CNS11643.1992-6" | |
399 ;; chinese-cns11643-7 "CNS11643.1992-7" | |
400 ;; chinese-big5-1 "Big5" | |
401 ;; chinese-big5-2 "Big5" | |
402 ;; chinese-sisheng "sisheng_cwnn" | |
403 ;; vietnamese-viscii-lower "VISCII1.1" | |
404 ;; vietnamese-viscii-upper "VISCII1.1" | |
405 ;; arabic-digit "MuleArabic-0" | |
406 ;; arabic-1-column "MuleArabic-1" | |
407 ;; arabic-2-column "MuleArabic-2" | |
408 ;; ipa "MuleIPA" | |
409 ;; ethiopic "Ethiopic-Unicode" | |
410 ;; indian-is13194 "IS13194-Devanagari" | |
411 ;; indian-2-column "MuleIndian-2" | |
412 ;; indian-1-column "MuleIndian-1" | |
413 ;; lao "MuleLao-1" | |
414 ;; tibetan "MuleTibetan-2" | |
415 ;; tibetan-1-column "MuleTibetan-1" | |
416 ;; latin-iso8859-14 "ISO8859-14" | |
417 ;; latin-iso8859-15 "ISO8859-15" | |
418 ;; mule-unicode-0100-24ff "ISO10646-1" | |
419 ;; mule-unicode-2500-33ff "ISO10646-1" | |
420 ;; mule-unicode-e000-ffff "ISO10646-1" | |
421 ;; japanese-jisx0213-1 "JISX0213.2000-1" | |
422 ;; japanese-jisx0213-2 "JISX0213.2000-2" | |
423 | |
424 ;;; Begin stuff from international/mule-conf.el. | |
425 | |
426 ; ;;; Definitions of character sets. | |
427 | |
428 ; ;; Basic (official) character sets. These character sets are treated | |
429 ; ;; efficiently with respect to buffer memory. | |
430 | |
431 ; ;; Syntax: | |
432 ; ;; (define-charset CHARSET-ID CHARSET | |
433 ; ;; [ DIMENSION CHARS WIDTH DIRECTION ISO-FINAL-CHAR ISO-GRAPHIC-PLANE | |
434 ; ;; SHORT-NAME LONG-NAME DESCRIPTION ]) | |
435 ; ;; ASCII charset is defined in src/charset.c as below. | |
436 ; ;; (define-charset 0 ascii | |
437 ; ;; [1 94 1 0 ?B 0 "ASCII" "ASCII" "ASCII (ISO646 IRV)"]) | |
438 | |
439 ; ;; 1-byte charsets. Valid range of CHARSET-ID is 128..143. | |
440 | |
441 ; ;; CHARSET-ID 128 is not used. | |
442 | |
443 ; ; An extra level of commenting means an official (done in C) charset. | |
444 ; ; (make-charset 'latin-iso8859-1 | |
445 ; ; "Right-Hand Part of Latin Alphabet 1 (ISO/IEC 8859-1): ISO-IR-100" | |
446 ; ; '(dimension | |
447 ; ; 1 | |
448 ; ; registry "ISO8859-1" | |
449 ; ; chars 96 | |
450 ; ; columns 1 | |
451 ; ; direction l2r | |
452 ; ; final ?A | |
453 ; ; graphic 1 | |
454 ; ; short-name "RHP of Latin-1" | |
455 ; ; long-name "RHP of Latin-1 (ISO 8859-1): ISO-IR-100" | |
456 ; ; )) | |
457 | |
458 ; ; (make-charset 'latin-iso8859-2 | |
459 ; ; "Right-Hand Part of Latin Alphabet 2 (ISO/IEC 8859-2): ISO-IR-101" | |
460 ; ; '(dimension | |
461 ; ; 1 | |
462 ; ; registry "ISO8859-2" | |
463 ; ; chars 96 | |
464 ; ; columns 1 | |
465 ; ; direction l2r | |
466 ; ; final ?B | |
467 ; ; graphic 1 | |
468 ; ; short-name "RHP of Latin-2" | |
469 ; ; long-name "RHP of Latin-2 (ISO 8859-2): ISO-IR-101" | |
470 ; ; )) | |
471 | |
472 ; ; (make-charset 'latin-iso8859-3 | |
473 ; ; "Right-Hand Part of Latin Alphabet 3 (ISO/IEC 8859-3): ISO-IR-109" | |
474 ; ; '(dimension | |
475 ; ; 1 | |
476 ; ; registry "ISO8859-3" | |
477 ; ; chars 96 | |
478 ; ; columns 1 | |
479 ; ; direction l2r | |
480 ; ; final ?C | |
481 ; ; graphic 1 | |
482 ; ; short-name "RHP of Latin-3" | |
483 ; ; long-name "RHP of Latin-3 (ISO 8859-3): ISO-IR-109" | |
484 ; ; )) | |
485 | |
486 ; ; (make-charset 'latin-iso8859-4 | |
487 ; ; "Right-Hand Part of Latin Alphabet 4 (ISO/IEC 8859-4): ISO-IR-110" | |
488 ; ; '(dimension | |
489 ; ; 1 | |
490 ; ; registry "ISO8859-4" | |
491 ; ; chars 96 | |
492 ; ; columns 1 | |
493 ; ; direction l2r | |
494 ; ; final ?D | |
495 ; ; graphic 1 | |
496 ; ; short-name "RHP of Latin-4" | |
497 ; ; long-name "RHP of Latin-4 (ISO 8859-4): ISO-IR-110" | |
498 ; ; )) | |
499 | |
500 ; ; (make-charset 'thai-tis620 | |
501 ; ; "Right-Hand Part of TIS620.2533 (Thai): ISO-IR-166" | |
502 ; ; '(dimension | |
503 ; ; 1 | |
504 ; ; registry "TIS620" | |
505 ; ; chars 96 | |
506 ; ; columns 1 | |
507 ; ; direction l2r | |
508 ; ; final ?T | |
509 ; ; graphic 1 | |
510 ; ; short-name "RHP of TIS620" | |
511 ; ; long-name "RHP of Thai (TIS620): ISO-IR-166" | |
512 ; ; )) | |
513 | |
514 ; ; (make-charset 'greek-iso8859-7 | |
515 ; ; "Right-Hand Part of Latin/Greek Alphabet (ISO/IEC 8859-7): ISO-IR-126" | |
516 ; ; '(dimension | |
517 ; ; 1 | |
518 ; ; registry "ISO8859-7" | |
519 ; ; chars 96 | |
520 ; ; columns 1 | |
521 ; ; direction l2r | |
522 ; ; final ?F | |
523 ; ; graphic 1 | |
524 ; ; short-name "RHP of ISO8859/7" | |
525 ; ; long-name "RHP of Greek (ISO 8859-7): ISO-IR-126" | |
526 ; ; )) | |
527 | |
528 ; ; (make-charset 'arabic-iso8859-6 | |
529 ; ; "Right-Hand Part of Latin/Arabic Alphabet (ISO/IEC 8859-6): ISO-IR-127" | |
530 ; ; '(dimension | |
531 ; ; 1 | |
532 ; ; registry "ISO8859-6" | |
533 ; ; chars 96 | |
534 ; ; columns 1 | |
535 ; ; direction r2l | |
536 ; ; final ?G | |
537 ; ; graphic 1 | |
538 ; ; short-name "RHP of ISO8859/6" | |
539 ; ; long-name "RHP of Arabic (ISO 8859-6): ISO-IR-127" | |
540 ; ; )) | |
541 | |
542 ; ; (make-charset 'hebrew-iso8859-8 | |
543 ; ; "Right-Hand Part of Latin/Hebrew Alphabet (ISO/IEC 8859-8): ISO-IR-138" | |
544 ; ; '(dimension | |
545 ; ; 1 | |
546 ; ; registry "ISO8859-8" | |
547 ; ; chars 96 | |
548 ; ; columns 1 | |
549 ; ; direction r2l | |
550 ; ; final ?H | |
551 ; ; graphic 1 | |
552 ; ; short-name "RHP of ISO8859/8" | |
553 ; ; long-name "RHP of Hebrew (ISO 8859-8): ISO-IR-138" | |
554 ; ; )) | |
555 | |
556 ; ; (make-charset 'katakana-jisx0201 | |
557 ; ; "Katakana Part of JISX0201.1976" | |
558 ; ; '(dimension | |
559 ; ; 1 | |
560 ; ; registry "JISX0201" | |
561 ; ; chars 94 | |
562 ; ; columns 1 | |
563 ; ; direction l2r | |
564 ; ; final ?I | |
565 ; ; graphic 1 | |
566 ; ; short-name "JISX0201 Katakana" | |
567 ; ; long-name "Japanese Katakana (JISX0201.1976)" | |
568 ; ; )) | |
569 | |
570 ; ; (make-charset 'latin-jisx0201 | |
571 ; ; "Roman Part of JISX0201.1976" | |
572 ; ; '(dimension | |
573 ; ; 1 | |
574 ; ; registry "JISX0201" | |
575 ; ; chars 94 | |
576 ; ; columns 1 | |
577 ; ; direction l2r | |
578 ; ; final ?J | |
579 ; ; graphic 0 | |
580 ; ; short-name "JISX0201 Roman" | |
581 ; ; long-name "Japanese Roman (JISX0201.1976)" | |
582 ; ; )) | |
583 | |
584 | |
585 ; ;; CHARSET-ID is not used 139. | |
586 | |
587 ; ; (make-charset 'cyrillic-iso8859-5 | |
588 ; ; "Right-Hand Part of Latin/Cyrillic Alphabet (ISO/IEC 8859-5): ISO-IR-144" | |
589 ; ; '(dimension | |
590 ; ; 1 | |
591 ; ; registry "ISO8859-5" | |
592 ; ; chars 96 | |
593 ; ; columns 1 | |
594 ; ; direction l2r | |
595 ; ; final ?L | |
596 ; ; graphic 1 | |
597 ; ; short-name "RHP of ISO8859/5" | |
598 ; ; long-name "RHP of Cyrillic (ISO 8859-5): ISO-IR-144" | |
599 ; ; )) | |
600 | |
601 ; ; (make-charset 'latin-iso8859-9 | |
602 ; ; "Right-Hand Part of Latin Alphabet 5 (ISO/IEC 8859-9): ISO-IR-148" | |
603 ; ; '(dimension | |
604 ; ; 1 | |
605 ; ; registry "ISO8859-9" | |
606 ; ; chars 96 | |
607 ; ; columns 1 | |
608 ; ; direction l2r | |
609 ; ; final ?M | |
610 ; ; graphic 1 | |
611 ; ; short-name "RHP of Latin-5" | |
612 ; ; long-name "RHP of Latin-5 (ISO 8859-9): ISO-IR-148" | |
613 ; ; )) | |
614 | |
615 ; ; (make-charset 'latin-iso8859-15 | |
616 ; ; "Right-Hand Part of Latin Alphabet 9 (ISO/IEC 8859-15): ISO-IR-203" | |
617 ; ; '(dimension | |
618 ; ; 1 | |
619 ; ; registry "ISO8859-15" | |
620 ; ; chars 96 | |
621 ; ; columns 1 | |
622 ; ; direction l2r | |
623 ; ; final ?b | |
624 ; ; graphic 1 | |
625 ; ; short-name "RHP of Latin-9" | |
626 ; ; long-name "RHP of Latin-9 (ISO 8859-15): ISO-IR-203" | |
627 ; ; )) | |
628 | |
629 ; (make-charset 'latin-iso8859-14 | |
630 ; "Right-Hand Part of Latin Alphabet 8 (ISO/IEC 8859-14)" | |
631 ; '(dimension | |
632 ; 1 | |
633 ; registry "ISO8859-14" | |
634 ; chars 96 | |
635 ; columns 1 | |
636 ; direction l2r | |
637 ; final ?_ | |
638 ; graphic 1 | |
639 ; short-name "RHP of Latin-8" | |
640 ; long-name "RHP of Latin-8 (ISO 8859-14)" | |
641 ; )) | |
642 | |
643 | |
644 ; ;; 2-byte charsets. Valid range of CHARSET-ID is 144..153. | |
645 | |
646 ; ; (make-charset 'japanese-jisx0208-1978 | |
647 ; ; "JISX0208.1978 Japanese Kanji (so called \"old JIS\"): ISO-IR-42" | |
648 ; ; '(dimension | |
649 ; ; 2 | |
650 ; ; registry "JISX0208.1990" | |
651 ; ; registry "JISX0208.1978" | |
652 ; ; chars 94 | |
653 ; ; columns 2 | |
654 ; ; direction l2r | |
655 ; ; final ?@ | |
656 ; ; graphic 0 | |
657 ; ; short-name "JISX0208.1978" | |
658 ; ; long-name "JISX0208.1978 (Japanese): ISO-IR-42" | |
659 ; ; )) | |
660 | |
661 ; ; (make-charset 'chinese-gb2312 | |
662 ; ; "GB2312 Chinese simplified: ISO-IR-58" | |
663 ; ; '(dimension | |
664 ; ; 2 | |
665 ; ; registry "GB2312.1980" | |
666 ; ; chars 94 | |
667 ; ; columns 2 | |
668 ; ; direction l2r | |
669 ; ; final ?A | |
670 ; ; graphic 0 | |
671 ; ; short-name "GB2312" | |
672 ; ; long-name "GB2312: ISO-IR-58" | |
673 ; ; )) | |
674 | |
675 ; ; (make-charset 'japanese-jisx0208 | |
676 ; ; "JISX0208.1983/1990 Japanese Kanji: ISO-IR-87" | |
677 ; ; '(dimension | |
678 ; ; 2 | |
679 ; ; chars 94 | |
680 ; ; columns 2 | |
681 ; ; direction l2r | |
682 ; ; final ?B | |
683 ; ; graphic 0 | |
684 ; ; short-name "JISX0208" | |
685 ; ; long-name "JISX0208.1983/1990 (Japanese): ISO-IR-87" | |
686 ; ; )) | |
687 | |
688 ; ; (make-charset 'korean-ksc5601 | |
689 ; ; "KSC5601 Korean Hangul and Hanja: ISO-IR-149" | |
690 ; ; '(dimension | |
691 ; ; 2 | |
692 ; ; registry "KSC5601.1989" | |
693 ; ; chars 94 | |
694 ; ; columns 2 | |
695 ; ; direction l2r | |
696 ; ; final ?C | |
697 ; ; graphic 0 | |
698 ; ; short-name "KSC5601" | |
699 ; ; long-name "KSC5601 (Korean): ISO-IR-149" | |
700 ; ; )) | |
701 | |
702 ; ; (make-charset 'japanese-jisx0212 | |
703 ; ; "JISX0212 Japanese supplement: ISO-IR-159" | |
704 ; ; '(dimension | |
705 ; ; 2 | |
706 ; ; registry "JISX0212" | |
707 ; ; chars 94 | |
708 ; ; columns 2 | |
709 ; ; direction l2r | |
710 ; ; final ?D | |
711 ; ; graphic 0 | |
712 ; ; short-name "JISX0212" | |
713 ; ; long-name "JISX0212 (Japanese): ISO-IR-159" | |
714 ; ; )) | |
715 | |
716 ; ; (make-charset 'chinese-cns11643-1 | |
717 ; ; "CNS11643 Plane 1 Chinese traditional: ISO-IR-171" | |
718 ; ; '(dimension | |
719 ; ; 2 | |
720 ; ; registry "CNS11643.1992-1" | |
721 ; ; chars 94 | |
722 ; ; columns 2 | |
723 ; ; direction l2r | |
724 ; ; final ?G | |
725 ; ; graphic 0 | |
726 ; ; short-name "CNS11643-1" | |
727 ; ; long-name "CNS11643-1 (Chinese traditional): ISO-IR-171" | |
728 ; ; )) | |
729 | |
730 ; ; (make-charset 'chinese-cns11643-2 | |
731 ; ; "CNS11643 Plane 2 Chinese traditional: ISO-IR-172" | |
732 ; ; '(dimension | |
733 ; ; 2 | |
734 ; ; registry "CNS11643.1992-2" | |
735 ; ; chars 94 | |
736 ; ; columns 2 | |
737 ; ; direction l2r | |
738 ; ; final ?H | |
739 ; ; graphic 0 | |
740 ; ; short-name "CNS11643-2" | |
741 ; ; long-name "CNS11643-2 (Chinese traditional): ISO-IR-172" | |
742 ; ; )) | |
743 | |
744 ; (make-charset 'japanese-jisx0213-1 "JISX0213 Plane 1 (Japanese)" | |
745 ; '(dimension | |
746 ; 2 | |
747 ; registry "JISX0213.2000-1" | |
748 ; chars 94 | |
749 ; columns 2 | |
750 ; direction l2r | |
751 ; final ?O | |
752 ; graphic 0 | |
753 ; short-name "JISX0213-1" | |
754 ; long-name "JISX0213-1" | |
755 ; )) | |
756 | |
757 ; ; (make-charset 'chinese-big5-1 | |
758 ; ; "Frequently used part (A141-C67F) of Big5 (Chinese traditional)" | |
759 ; ; '(dimension | |
760 ; ; 2 | |
761 ; ; registry "Big5" | |
762 ; ; chars 94 | |
763 ; ; columns 2 | |
764 ; ; direction l2r | |
765 ; ; final ?0 | |
766 ; ; graphic 0 | |
767 ; ; short-name "Big5 (Level-1)" | |
768 ; ; long-name "Big5 (Level-1) A141-C67F" | |
769 ; ; )) | |
770 | |
771 ; ; (make-charset 'chinese-big5-2 | |
772 ; ; "Less frequently used part (C940-FEFE) of Big5 (Chinese traditional)" | |
773 ; ; '(dimension | |
774 ; ; 2 | |
775 ; ; registry "Big5" | |
776 ; ; chars 94 | |
777 ; ; columns 2 | |
778 ; ; direction l2r | |
779 ; ; final ?1 | |
780 ; ; graphic 0 | |
781 ; ; short-name "Big5 (Level-2)" | |
782 ; ; long-name "Big5 (Level-2) C940-FEFE" | |
783 ; ; )) | |
784 | |
785 | |
786 ; ;; Additional (private) character sets. These character sets are | |
787 ; ;; treated less space-efficiently in the buffer. | |
788 | |
789 ; ;; Syntax: | |
790 ; ;; (define-charset CHARSET-ID CHARSET | |
791 ; ;; [ DIMENSION CHARS WIDTH DIRECTION ISO-FINAL-CHAR ISO-GRAPHIC-PLANE | |
792 ; ;; SHORT-NAME LONG-NAME DESCRIPTION ]) | |
793 | |
794 ; ;; ISO-2022 allows a use of character sets not registered in ISO with | |
795 ; ;; final characters `0' (0x30) through `?' (0x3F). Among them, Emacs | |
796 ; ;; reserves `0' through `9' to support several private character sets. | |
797 ; ;; The remaining final characters `:' through `?' are for users. | |
798 | |
799 ; ;; 1-byte 1-column charsets. Valid range of CHARSET-ID is 160..223. | |
800 | |
801 ; (make-charset 'chinese-sisheng | |
802 ; "SiSheng characters for PinYin/ZhuYin" | |
803 ; '(dimension | |
804 ; 1 | |
805 ; registry "sisheng_cwnn" | |
806 ; chars 94 | |
807 ; columns 1 | |
808 ; direction l2r | |
809 ; final ?0 | |
810 ; graphic 0 | |
811 ; short-name "SiSheng" | |
812 ; long-name "SiSheng (PinYin/ZhuYin)" | |
813 ; )) | |
814 | |
815 | |
816 ; ;; IPA characters for phonetic symbols. | |
817 ; (make-charset 'ipa "IPA (International Phonetic Association)" | |
818 ; '(dimension | |
819 ; 1 | |
820 ; registry "MuleIPA" | |
821 ; chars 96 | |
822 ; columns 1 | |
823 ; direction l2r | |
824 ; final ?0 | |
825 ; graphic 1 | |
826 ; short-name "IPA" | |
827 ; long-name "IPA" | |
828 ; )) | |
829 | |
830 | |
831 ; ;; Vietnamese VISCII. VISCII is 1-byte character set which contains | |
832 ; ;; more than 96 characters. Since Emacs can't handle it as one | |
833 ; ;; character set, it is divided into two: lower case letters and upper | |
834 ; ;; case letters. | |
835 ; (make-charset 'vietnamese-viscii-lower "VISCII1.1 lower-case" | |
836 ; '(dimension | |
837 ; 1 | |
838 ; registry "VISCII1.1" | |
839 ; chars 96 | |
840 ; columns 1 | |
841 ; direction l2r | |
842 ; final ?1 | |
843 ; graphic 1 | |
844 ; short-name "VISCII lower" | |
845 ; long-name "VISCII lower-case" | |
846 ; )) | |
847 | |
848 ; (make-charset 'vietnamese-viscii-upper "VISCII1.1 upper-case" | |
849 ; '(dimension | |
850 ; 1 | |
851 ; registry "VISCII1.1" | |
852 ; chars 96 | |
853 ; columns 1 | |
854 ; direction l2r | |
855 ; final ?2 | |
856 ; graphic 1 | |
857 ; short-name "VISCII upper" | |
858 ; long-name "VISCII upper-case" | |
859 ; )) | |
860 | |
861 | |
862 ; ;; For Arabic, we need three different types of character sets. | |
863 ; ;; Digits are of direction left-to-right and of width 1-column. | |
864 ; ;; Others are of direction right-to-left and of width 1-column or | |
865 ; ;; 2-column. | |
866 ; (make-charset 'arabic-digit "Arabic digit" | |
867 ; '(dimension | |
868 ; 1 | |
869 ; registry "MuleArabic-0" | |
870 ; chars 94 | |
871 ; columns 1 | |
872 ; direction l2r | |
873 ; final ?2 | |
874 ; graphic 0 | |
875 ; short-name "Arabic digit" | |
876 ; long-name "Arabic digit" | |
877 ; )) | |
878 | |
879 ; (make-charset 'arabic-1-column "Arabic 1-column" | |
880 ; '(dimension | |
881 ; 1 | |
882 ; registry "MuleArabic-1" | |
883 ; chars 94 | |
884 ; columns 1 | |
885 ; direction r2l | |
886 ; final ?3 | |
887 ; graphic 0 | |
888 ; short-name "Arabic 1-col" | |
889 ; long-name "Arabic 1-column" | |
890 ; )) | |
891 | |
892 | |
893 ; ;; ASCII with right-to-left direction. | |
894 ; (make-charset 'ascii-right-to-left | |
895 ; "ASCII (left half of ISO 8859-1) with right-to-left direction" | |
896 ; '(dimension | |
897 ; 1 | |
898 ; registry "ISO8859-1" | |
899 ; chars 94 | |
900 ; columns 1 | |
901 ; direction r2l | |
902 ; final ?B | |
903 ; graphic 0 | |
904 ; short-name "rev ASCII" | |
905 ; long-name "ASCII with right-to-left direction" | |
906 ; )) | |
907 | |
908 | |
909 ; ;; Lao script. | |
910 ; ;; ISO10646's 0x0E80..0x0EDF are mapped to 0x20..0x7F. | |
911 ; (make-charset 'lao "Lao characters (ISO10646 0E80..0EDF)" | |
912 ; '(dimension | |
913 ; 1 | |
914 ; registry "MuleLao-1" | |
915 ; chars 94 | |
916 ; columns 1 | |
917 ; direction l2r | |
918 ; final ?1 | |
919 ; graphic 0 | |
920 ; short-name "Lao" | |
921 ; long-name "Lao" | |
922 ; )) | |
923 | |
924 | |
925 ; ;; CHARSET-IDs 168..223 are not used. | |
926 | |
927 ; ;; 1-byte 2-column charsets. Valid range of CHARSET-ID is 224..239. | |
928 | |
929 ; (make-charset 'arabic-2-column "Arabic 2-column" | |
930 ; '(dimension | |
931 ; 1 | |
932 ; registry "MuleArabic-2" | |
933 ; chars 94 | |
934 ; columns 2 | |
935 ; direction r2l | |
936 ; final ?4 | |
937 ; graphic 0 | |
938 ; short-name "Arabic 2-col" | |
939 ; long-name "Arabic 2-column" | |
940 ; )) | |
941 | |
942 | |
943 ; ;; Indian scripts. Symbolic charset for data exchange. Glyphs are | |
944 ; ;; not assigned. They are automatically converted to each Indian | |
945 ; ;; script which IS-13194 supports. | |
946 | |
947 ; (make-charset 'indian-is13194 | |
948 ; "Generic Indian charset for data exchange with IS 13194" | |
949 ; '(dimension | |
950 ; 1 | |
951 ; registry "IS13194-Devanagari" | |
952 ; chars 94 | |
953 ; columns 2 | |
954 ; direction l2r | |
955 ; final ?5 | |
956 ; graphic 1 | |
957 ; short-name "IS 13194" | |
958 ; long-name "Indian IS 13194" | |
959 ; )) | |
960 | |
961 | |
962 ; ;; CHARSET-IDs 226..239 are not used. | |
963 | |
964 ; ;; 2-byte 1-column charsets. Valid range of CHARSET-ID is 240..244. | |
965 | |
966 ; ;; Actual Glyph for 1-column width. | |
967 ; (make-charset 'indian-1-column | |
968 ; "Indian charset for 2-column width glyphs" | |
969 ; '(dimension | |
970 ; 2 | |
971 ; registry "MuleIndian-1" | |
972 ; chars 94 | |
973 ; columns 1 | |
974 ; direction l2r | |
975 ; final ?6 | |
976 ; graphic 0 | |
977 ; short-name "Indian 1-col" | |
978 ; long-name "Indian 1 Column" | |
979 ; )) | |
980 | |
981 | |
982 ; (make-charset 'tibetan-1-column "Tibetan 1 column glyph" | |
983 ; '(dimension | |
984 ; 2 | |
985 ; registry "MuleTibetan-1" | |
986 ; chars 94 | |
987 ; columns 1 | |
988 ; direction l2r | |
989 ; final ?8 | |
990 ; graphic 0 | |
991 ; short-name "Tibetan 1-col" | |
992 ; long-name "Tibetan 1 column" | |
993 ; )) | |
994 | |
995 | |
996 ; ;; Subsets of Unicode. | |
997 | |
998 ; (make-charset 'mule-unicode-2500-33ff | |
999 ; "Unicode characters of the range U+2500..U+33FF." | |
1000 ; '(dimension | |
1001 ; 2 | |
1002 ; registry "ISO10646-1" | |
1003 ; chars 96 | |
1004 ; columns 1 | |
1005 ; direction l2r | |
1006 ; final ?2 | |
1007 ; graphic 0 | |
1008 ; short-name "Unicode subset 2" | |
1009 ; long-name "Unicode subset (U+2500..U+33FF)" | |
1010 ; )) | |
1011 | |
1012 | |
1013 ; (make-charset 'mule-unicode-e000-ffff | |
1014 ; "Unicode characters of the range U+E000..U+FFFF." | |
1015 ; '(dimension | |
1016 ; 2 | |
1017 ; registry "ISO10646-1" | |
1018 ; chars 96 | |
1019 ; columns 1 | |
1020 ; direction l2r | |
1021 ; final ?3 | |
1022 ; graphic 0 | |
1023 ; short-name "Unicode subset 3" | |
1024 ; long-name "Unicode subset (U+E000+FFFF)" | |
1025 ; )) | |
1026 | |
1027 | |
1028 ; (make-charset 'mule-unicode-0100-24ff | |
1029 ; "Unicode characters of the range U+0100..U+24FF." | |
1030 ; '(dimension | |
1031 ; 2 | |
1032 ; registry "ISO10646-1" | |
1033 ; chars 96 | |
1034 ; columns 1 | |
1035 ; direction l2r | |
1036 ; final ?1 | |
1037 ; graphic 0 | |
1038 ; short-name "Unicode subset" | |
1039 ; long-name "Unicode subset (U+0100..U+24FF)" | |
1040 ; )) | |
1041 | |
1042 | |
1043 ; ;; 2-byte 2-column charsets. Valid range of CHARSET-ID is 245..254. | |
1044 | |
1045 ; ;; Ethiopic characters (Amahric and Tigrigna). | |
1046 ; (make-charset 'ethiopic "Ethiopic characters" | |
1047 ; '(dimension | |
1048 ; 2 | |
1049 ; registry "Ethiopic-Unicode" | |
1050 ; chars 94 | |
1051 ; columns 2 | |
1052 ; direction l2r | |
1053 ; final ?3 | |
1054 ; graphic 0 | |
1055 ; short-name "Ethiopic" | |
1056 ; long-name "Ethiopic characters" | |
1057 ; )) | |
1058 | |
1059 | |
1060 ; ;; Chinese CNS11643 Plane3 thru Plane7. Although these are official | |
1061 ; ;; character sets, the use is rare and don't have to be treated | |
1062 ; ;; space-efficiently in the buffer. | |
1063 ; (make-charset 'chinese-cns11643-3 | |
1064 ; "CNS11643 Plane 3 Chinese Traditional: ISO-IR-183" | |
1065 ; '(dimension | |
1066 ; 2 | |
1067 ; registry "CNS11643.1992-3" | |
1068 ; chars 94 | |
1069 ; columns 2 | |
1070 ; direction l2r | |
1071 ; final ?I | |
1072 ; graphic 0 | |
1073 ; short-name "CNS11643-3" | |
1074 ; long-name "CNS11643-3 (Chinese traditional): ISO-IR-183" | |
1075 ; )) | |
1076 | |
1077 ; (make-charset 'chinese-cns11643-4 | |
1078 ; "CNS11643 Plane 4 Chinese Traditional: ISO-IR-184" | |
1079 ; '(dimension | |
1080 ; 2 | |
1081 ; registry "CNS11643.1992-4" | |
1082 ; chars 94 | |
1083 ; columns 2 | |
1084 ; direction l2r | |
1085 ; final ?J | |
1086 ; graphic 0 | |
1087 ; short-name "CNS11643-4" | |
1088 ; long-name "CNS11643-4 (Chinese traditional): ISO-IR-184" | |
1089 ; )) | |
1090 | |
1091 ; (make-charset 'chinese-cns11643-5 | |
1092 ; "CNS11643 Plane 5 Chinese Traditional: ISO-IR-185" | |
1093 ; '(dimension | |
1094 ; 2 | |
1095 ; registry "CNS11643.1992-5" | |
1096 ; chars 94 | |
1097 ; columns 2 | |
1098 ; direction l2r | |
1099 ; final ?K | |
1100 ; graphic 0 | |
1101 ; short-name "CNS11643-5" | |
1102 ; long-name "CNS11643-5 (Chinese traditional): ISO-IR-185" | |
1103 ; )) | |
1104 | |
1105 ; (make-charset 'chinese-cns11643-6 | |
1106 ; "CNS11643 Plane 6 Chinese Traditional: ISO-IR-186" | |
1107 ; '(dimension | |
1108 ; 2 | |
1109 ; registry "CNS11643.1992-6" | |
1110 ; chars 94 | |
1111 ; columns 2 | |
1112 ; direction l2r | |
1113 ; final ?L | |
1114 ; graphic 0 | |
1115 ; short-name "CNS11643-6" | |
1116 ; long-name "CNS11643-6 (Chinese traditional): ISO-IR-186" | |
1117 ; )) | |
1118 | |
1119 ; (make-charset 'chinese-cns11643-7 | |
1120 ; "CNS11643 Plane 7 Chinese Traditional: ISO-IR-187" | |
1121 ; '(dimension | |
1122 ; 2 | |
1123 ; registry "CNS11643.1992-7" | |
1124 ; chars 94 | |
1125 ; columns 2 | |
1126 ; direction l2r | |
1127 ; final ?M | |
1128 ; graphic 0 | |
1129 ; short-name "CNS11643-7" | |
1130 ; long-name "CNS11643-7 (Chinese traditional): ISO-IR-187" | |
1131 ; )) | |
1132 | |
1133 | |
1134 ; ;; Actual Glyph for 2-column width. | |
1135 ; (make-charset 'indian-2-column | |
1136 ; "Indian charset for 2-column width glyphs" | |
1137 ; '(dimension | |
1138 ; 2 | |
1139 ; registry "MuleIndian-2" | |
1140 ; chars 94 | |
1141 ; columns 2 | |
1142 ; direction l2r | |
1143 ; final ?5 | |
1144 ; graphic 0 | |
1145 ; short-name "Indian 2-col" | |
1146 ; long-name "Indian 2 Column" | |
1147 ; )) | |
1148 | |
1149 | |
1150 ; ;; Tibetan script. | |
1151 ; (make-charset 'tibetan "Tibetan characters" | |
1152 ; '(dimension | |
1153 ; 2 | |
1154 ; registry "MuleTibetan-2" | |
1155 ; chars 94 | |
1156 ; columns 2 | |
1157 ; direction l2r | |
1158 ; final ?7 | |
1159 ; graphic 0 | |
1160 ; short-name "Tibetan 2-col" | |
1161 ; long-name "Tibetan 2 column" | |
1162 ; )) | |
1163 | |
1164 | |
1165 ; ;; CHARSET-ID 253 is not used. | |
1166 | |
1167 ; ;; JISX0213 Plane 2 | |
1168 ; (make-charset 'japanese-jisx0213-2 "JISX0213 Plane 2 (Japanese)" | |
1169 ; '(dimension | |
1170 ; 2 | |
1171 ; registry "JISX0213.2000-2" | |
1172 ; chars 94 | |
1173 ; columns 2 | |
1174 ; direction l2r | |
1175 ; final ?P | |
1176 ; graphic 0 | |
1177 ; short-name "JISX0213-2" | |
1178 ; long-name "JISX0213-2" | |
1179 ; )) | |
1180 | |
428 | 1181 ;;; mule-charset.el ends here |
778 | 1182 |