Mercurial > emacs
annotate lisp/international/mule.el @ 18420:2de852dd7271 libc-970624 libc-970625 libc-970626 libc-970627
* config.sub (mn10200): Recognize new basic machine.
author | Jeff Law <law@redhat.com> |
---|---|
date | Mon, 23 Jun 1997 17:53:11 +0000 |
parents | 8b4a66c66dd6 |
children | 615e9654bf59 |
rev | line source |
---|---|
17052 | 1 ;;; mule.el --- basic commands for mulitilingual environment |
2 | |
3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. | |
4 | |
5 ;; Keywords: mule, multilingual, character set, coding system | |
6 | |
7 ;; This file is part of GNU Emacs. | |
8 | |
9 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
10 ;; it under the terms of the GNU General Public License as published by | |
11 ;; the Free Software Foundation; either version 2, or (at your option) | |
12 ;; any later version. | |
13 | |
14 ;; GNU Emacs is distributed in the hope that it will be useful, | |
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 ;; GNU General Public License for more details. | |
18 | |
19 ;; You should have received a copy of the GNU General Public License | |
17071 | 20 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
22 ;; Boston, MA 02111-1307, USA. | |
17052 | 23 |
24 ;;; Code: | |
25 | |
26 (defconst mule-version "3.0 (MOMIJINOGA)" "\ | |
27 Version number and name of this version of MULE (multilingual environment).") | |
28 | |
29 (defconst mule-version-date "1998.1.1" "\ | |
30 Distribution date of this version of MULE (multilingual environment).") | |
31 | |
32 (defun load-with-code-conversion (fullname file &optional noerror nomessage) | |
33 "Execute a file of Lisp code named FILE whose absolute path is FULLNAME. | |
34 The FILE is decoded before evaluation if necessary. | |
35 If optional second arg NOERROR is non-nil, | |
36 report no error if FILE doesn't exist. | |
37 Print messages at start and end of loading unless | |
38 optional third arg NOMESSAGE is non-nil. | |
39 Return t if file exists." | |
40 (if (null (file-readable-p fullname)) | |
41 (and (null noerror) | |
42 (signal 'file-error (list "Cannot open load file" file))) | |
43 ;; Read file with code conversion, and then eval. | |
44 (let* ((buffer | |
45 ;; To avoid any autoloading, set default-major-mode to | |
46 ;; fundamental-mode. | |
47 (let ((default-major-mode 'fundamental-mode)) | |
48 ;; We can't use `generate-new-buffer' because files.el | |
49 ;; is not yet loaded. | |
50 (get-buffer-create (generate-new-buffer-name " *load*")))) | |
51 (load-in-progress t)) | |
52 (or nomessage (message "Loading %s..." file)) | |
53 (unwind-protect | |
54 (progn | |
55 (save-excursion | |
56 (set-buffer buffer) | |
57 (insert-file-contents fullname) | |
58 ;; We must set `buffer-file-name' for `eval-buffer' and | |
59 ;; `load-history'. | |
60 (setq buffer-file-name file) | |
61 ;; Make `kill-buffer' quiet. | |
62 (set-buffer-modified-p nil)) | |
63 ;; Eval in the original buffer. | |
64 (eval-buffer buffer)) | |
65 (kill-buffer buffer)) | |
66 (let ((hook (assoc file after-load-alist))) | |
67 (if hook | |
68 (mapcar (function eval) (cdr hook)))) | |
69 (or nomessage noninteractive | |
70 (message "Loading %s...done" file)) | |
71 t))) | |
72 | |
73 ;; API (Application Program Interface) for charsets. | |
74 | |
75 ;; Return t if OBJ is a quoted symbol. | |
76 (defsubst quoted-symbol-p (obj) | |
77 (and (listp obj) (eq (car obj) 'quote))) | |
78 | |
79 (defsubst charsetp (object) | |
80 "T is OBJECT is a charset." | |
81 (and (symbolp object) (vectorp (get object 'charset)))) | |
82 | |
83 (defsubst charset-info (charset) | |
84 "Return a vector of information of CHARSET. | |
85 The elements of the vector are: | |
86 CHARSET-ID, BYTES, DIMENSION, CHARS, WIDTH, DIRECTION, | |
87 LEADING-CODE-BASE, LEADING-CODE-EXT, | |
88 ISO-FINAL-CHAR, ISO-GRAPHIC-PLANE, | |
89 REVERSE-CHARSET, SHORT-NAME, LONG-NAME, DESCRIPTION, | |
90 PLIST, | |
91 where | |
92 CHARSET-ID (integer) is the identification number of the charset. | |
93 DIMENSION (integer) is the number of bytes to represent a character of | |
94 the charset: 1 or 2. | |
95 CHARS (integer) is the number of characters in a dimension: 94 or 96. | |
96 BYTE (integer) is the length of multi-byte form of a character in | |
97 the charset: one of 1, 2, 3, and 4. | |
98 WIDTH (integer) is the number of columns a character in the charset | |
99 occupies on the screen: one of 0, 1, and 2. | |
100 DIRECTION (integer) is the rendering direction of characters in the | |
101 charset when rendering. If 0, render from right to left, else | |
102 render from left to right. | |
103 LEADING-CODE-BASE (integer) is the base leading-code for the | |
104 charset. | |
105 LEADING-CODE-EXT (integer) is the extended leading-code for the | |
106 charset. All charsets of less than 0xA0 has the value 0. | |
107 ISO-FINAL-CHAR (character) is the final character of the | |
108 corresponding ISO 2022 charset. | |
109 ISO-GRAPHIC-PLANE (integer) is the graphic plane to be invoked | |
110 while encoding to variants of ISO 2022 coding system, one of the | |
111 following: 0/graphic-plane-left(GL), 1/graphic-plane-right(GR). | |
112 REVERSE-CHARSET (integer) is the charset which differs only in | |
113 LEFT-TO-RIGHT value from the charset. If there's no such a | |
114 charset, the value is -1. | |
115 SHORT-NAME (string) is the short name to refer to the charset. | |
116 LONG-NAME (string) is the long name to refer to the charset | |
117 DESCRIPTION (string) is the description string of the charset. | |
118 PLIST (property list) may contain any type of information a user | |
119 want to put and get by functions `put-charset-property' and | |
120 `get-charset-property' respectively." | |
121 (get charset 'charset)) | |
122 | |
123 (defmacro charset-id (charset) | |
124 "Return charset identification number of CHARSET." | |
125 (if (and (listp charset) (eq (car charset) 'quote)) | |
126 (aref (charset-info (nth 1 charset)) 0) | |
127 `(aref (charset-info ,charset) 0))) | |
128 | |
129 (defmacro charset-bytes (charset) | |
130 (if (quoted-symbol-p charset) | |
131 (aref (charset-info (nth 1 charset)) 1) | |
132 `(aref (charset-info ,charset) 1))) | |
133 | |
134 (defmacro charset-dimension (charset) | |
135 (if (quoted-symbol-p charset) | |
136 (aref (charset-info (nth 1 charset)) 2) | |
137 `(aref (charset-info ,charset) 2))) | |
138 | |
139 (defmacro charset-chars (charset) | |
140 (if (quoted-symbol-p charset) | |
141 (aref (charset-info (nth 1 charset)) 3) | |
142 `(aref (charset-info ,charset) 3))) | |
143 | |
144 (defmacro charset-width (charset) | |
145 (if (quoted-symbol-p charset) | |
146 (aref (charset-info (nth 1 charset)) 4) | |
147 `(aref (charset-info ,charset) 4))) | |
148 | |
149 (defmacro charset-direction (charset) | |
150 (if (quoted-symbol-p charset) | |
151 (aref (charset-info (nth 1 charset)) 5) | |
152 `(aref (charset-info ,charset) 5))) | |
153 | |
154 (defmacro charset-iso-final-char (charset) | |
155 (if (quoted-symbol-p charset) | |
156 (aref (charset-info (nth 1 charset)) 8) | |
157 `(aref (charset-info ,charset) 8))) | |
158 | |
159 (defmacro charset-iso-graphic-plane (charset) | |
160 (if (quoted-symbol-p charset) | |
161 (aref (charset-info (nth 1 charset)) 9) | |
162 `(aref (charset-info ,charset) 9))) | |
163 | |
164 (defmacro charset-reverse-charset (charset) | |
165 (if (quoted-symbol-p charset) | |
166 (aref (charset-info (nth 1 charset)) 10) | |
167 `(aref (charset-info ,charset) 10))) | |
168 | |
169 (defmacro charset-short-name (charset) | |
170 (if (quoted-symbol-p charset) | |
171 (aref (charset-info (nth 1 charset)) 11) | |
172 `(aref (charset-info ,charset) 11))) | |
173 | |
174 (defmacro charset-long-name (charset) | |
175 (if (quoted-symbol-p charset) | |
176 (aref (charset-info (nth 1 charset)) 12) | |
177 `(aref (charset-info ,charset) 12))) | |
178 | |
179 (defmacro charset-description (charset) | |
180 (if (quoted-symbol-p charset) | |
181 (aref (charset-info (nth 1 charset)) 13) | |
182 `(aref (charset-info ,charset) 13))) | |
183 | |
184 (defmacro charset-plist (charset) | |
185 (if (quoted-symbol-p charset) | |
17175 | 186 `(aref ,(charset-info (nth 1 charset)) 14) |
17052 | 187 `(aref (charset-info ,charset) 14))) |
188 | |
189 (defun set-charset-plist (charset plist) | |
190 (aset (charset-info charset) 14 plist)) | |
191 | |
192 (defmacro make-char (charset &optional c1 c2) | |
17175 | 193 "Return a character of CHARSET and position-codes CODE1 and CODE2. |
194 CODE1 and CODE2 are optional, but if you don't supply | |
195 sufficient position-codes, return a generic character which stands for | |
196 all characters or group of characters in the character sets. | |
17761
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
197 A generic character can be used to index a char table (e.g. syntax-table)." |
17052 | 198 (if (quoted-symbol-p charset) |
199 `(make-char-internal ,(charset-id (nth 1 charset)) ,c1 ,c2) | |
200 `(make-char-internal (charset-id ,charset) ,c1 ,c2))) | |
201 | |
17094
c237252970e5
(make-coding-system): For ISO-2022 type conding systems,
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
202 (defmacro charset-list () |
c237252970e5
(make-coding-system): For ISO-2022 type conding systems,
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
203 "Return list of charsets ever defined." |
17837
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
204 'charset-list) |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
205 |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
206 (defsubst generic-char-p (char) |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
207 "Return t if and only if CHAR is a generic character. |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
208 See also the documentation of make-char." |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
209 (let ((l (split-char char))) |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
210 (and (or (= (nth 1 l) 0) (eq (nth 2 l) 0)) |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
211 (not (eq (car l) 'composition))))) |
17094
c237252970e5
(make-coding-system): For ISO-2022 type conding systems,
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
212 |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
213 ;; Coding system staffs |
17052 | 214 |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
215 ;; Coding system is a symbol that has the property `coding-system'. |
17052 | 216 ;; |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
217 ;; The value of the property `coding-system' is a vector of the |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
218 ;; following format: |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
219 ;; [TYPE MNEMONIC DOC-STRING NOT-USED-NOW FLAGS] |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
220 ;; We call this vector as coding-spec. See comments in src/coding.c |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
221 ;; for more detail. The property value may be another coding system, |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
222 ;; in which case, the coding-spec should be taken from that |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
223 ;; coding-system. The 4th element NOT-USED-NOW is kept just for |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
224 ;; backward compatibility with old version of Mule. |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
225 |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
226 (defconst coding-spec-type-idx 0) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
227 (defconst coding-spec-mnemonic-idx 1) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
228 (defconst coding-spec-doc-string-idx 2) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
229 (defconst coding-spec-flags-idx 4) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
230 |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
231 ;; Coding system may have proerpty `eol-type'. The value of the |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
232 ;; property `eol-type' is integer 0..2 or a vector of three coding |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
233 ;; systems. The integer value 0, 1, and 2 indicate the format of |
17052 | 234 ;; end-of-line LF, CRLF, and CR respectively. The vector value |
235 ;; indicates that the format of end-of-line should be detected | |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
236 ;; automatically. Nth element of the vector is the subsidiary coding |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
237 ;; system whose `eol-type' property is N. |
17052 | 238 ;; |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
239 ;; Coding system may also have properties `post-read-conversion' and |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
240 ;; `pre-write-conversion. Values of these properties are functions. |
17052 | 241 ;; |
242 ;; The function in `post-read-conversion' is called after some text is | |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
243 ;; inserted and decoded along the coding system and before any |
17052 | 244 ;; functions in `after-insert-functions' are called. The arguments to |
245 ;; this function is the same as those of a function in | |
246 ;; `after-insert-functions', i.e. LENGTH of a text while putting point | |
247 ;; at the head of the text to be decoded | |
248 ;; | |
249 ;; The function in `pre-write-conversion' is called after all | |
250 ;; functions in `write-region-annotate-functions' and | |
251 ;; `buffer-file-format' are called, and before the text is encoded by | |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
252 ;; the coding system. The arguments to this function is the same as |
17052 | 253 ;; those of a function in `write-region-annotate-functions', i.e. FROM |
254 ;; and TO specifying region of a text. | |
255 | |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
256 ;; Return Nth element of coding-spec of CODING-SYSTEM. |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
257 (defun coding-system-spec-ref (coding-system n) |
17094
c237252970e5
(make-coding-system): For ISO-2022 type conding systems,
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
258 (check-coding-system coding-system) |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
259 (let ((vec (coding-system-spec coding-system))) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
260 (and vec (aref vec n)))) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
261 |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
262 (defun coding-system-type (coding-system) |
18298
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
263 "Return TYPE element in coding-spec of CODING-SYSTEM." |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
264 (coding-system-spec-ref coding-system coding-spec-type-idx)) |
17052 | 265 |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
266 (defun coding-system-mnemonic (coding-system) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
267 "Return MNEMONIC element in coding-spec of CODING-SYSTEM." |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
268 (or (coding-system-spec-ref coding-system coding-spec-mnemonic-idx) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
269 ?-)) |
17052 | 270 |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
271 (defun coding-system-doc-string (coding-system) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
272 "Return DOC-STRING element in coding-spec of CODING-SYSTEM." |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
273 (coding-system-spec-ref coding-system coding-spec-doc-string-idx)) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
274 |
17052 | 275 (defun coding-system-flags (coding-system) |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
276 "Return FLAGS element in coding-spec of CODING-SYSTEM." |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
277 (coding-system-spec-ref coding-system coding-spec-flags-idx)) |
17052 | 278 |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
279 (defun coding-system-eol-type (coding-system) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
280 "Return eol-type property of CODING-SYSTEM." |
17094
c237252970e5
(make-coding-system): For ISO-2022 type conding systems,
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
281 (check-coding-system coding-system) |
17052 | 282 (and coding-system |
283 (or (get coding-system 'eol-type) | |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
284 (coding-system-eol-type (get coding-system 'coding-system))))) |
17052 | 285 |
18298
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
286 (defun coding-system-category (coding-system) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
287 "Return coding category of CODING-SYSTEM." |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
288 (and coding-system |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
289 (symbolp coding-system) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
290 (or (get coding-system 'coding-category) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
291 (coding-system-category (get coding-system 'coding-system))))) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
292 |
18312
705da3ce58c0
(coding-system-parent): Moved from mule-util.el.
Kenichi Handa <handa@m17n.org>
parents:
18298
diff
changeset
|
293 (defun coding-system-parent (coding-system) |
705da3ce58c0
(coding-system-parent): Moved from mule-util.el.
Kenichi Handa <handa@m17n.org>
parents:
18298
diff
changeset
|
294 "Return parent of CODING-SYSTEM." |
705da3ce58c0
(coding-system-parent): Moved from mule-util.el.
Kenichi Handa <handa@m17n.org>
parents:
18298
diff
changeset
|
295 (let ((parent (get coding-system 'parent-coding-system))) |
705da3ce58c0
(coding-system-parent): Moved from mule-util.el.
Kenichi Handa <handa@m17n.org>
parents:
18298
diff
changeset
|
296 (and parent |
705da3ce58c0
(coding-system-parent): Moved from mule-util.el.
Kenichi Handa <handa@m17n.org>
parents:
18298
diff
changeset
|
297 (or (coding-system-parent parent) |
705da3ce58c0
(coding-system-parent): Moved from mule-util.el.
Kenichi Handa <handa@m17n.org>
parents:
18298
diff
changeset
|
298 parent)))) |
705da3ce58c0
(coding-system-parent): Moved from mule-util.el.
Kenichi Handa <handa@m17n.org>
parents:
18298
diff
changeset
|
299 |
18298
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
300 ;; Make subsidiary coding systems (eol-type variants) of CODING-SYSTEM. |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
301 (defun make-subsidiary-coding-system (coding-system) |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
302 (let ((subsidiaries (vector (intern (format "%s-unix" coding-system)) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
303 (intern (format "%s-dos" coding-system)) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
304 (intern (format "%s-mac" coding-system)))) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
305 (i 0)) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
306 (while (< i 3) |
18298
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
307 (put (aref subsidiaries i) 'coding-system coding-system) |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
308 (put (aref subsidiaries i) 'eol-type i) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
309 (put (aref subsidiaries i) 'eol-variant t) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
310 (setq i (1+ i))) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
311 subsidiaries)) |
17052 | 312 |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
313 (defun make-coding-system (coding-system type mnemonic doc-string |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
314 &optional flags) |
17052 | 315 "Define a new CODING-SYSTEM (symbol). |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
316 Remaining arguments are TYPE, MNEMONIC, DOC-STRING, and FLAGS (optional) which |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
317 construct a coding-spec of CODING-SYSTEM in the following format: |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
318 [TYPE MNEMONIC DOC-STRING nil FLAGS] |
17052 | 319 TYPE is an integer value indicating the type of coding-system as follows: |
320 0: Emacs internal format, | |
321 1: Shift-JIS (or MS-Kanji) used mainly on Japanese PC, | |
322 2: ISO-2022 including many variants, | |
323 3: Big5 used mainly on Chinese PC, | |
324 4: private, CCL programs provide encoding/decoding algorithm. | |
325 MNEMONIC is a character to be displayed on mode line for the coding-system. | |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
326 DOC-STRING is a documentation string for the coding-system. |
17052 | 327 FLAGS specifies more precise information of each TYPE. |
328 If TYPE is 2 (ISO-2022), FLAGS should be a list of: | |
329 CHARSET0, CHARSET1, CHARSET2, CHARSET3, SHORT-FORM, | |
330 ASCII-EOL, ASCII-CNTL, SEVEN, LOCKING-SHIFT, SINGLE-SHIFT, | |
17761
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
331 USE-ROMAN, USE-OLDJIS, NO-ISO6429, INIT-BOL, DESIGNATION-BOL. |
17052 | 332 CHARSETn are character sets initially designated to Gn graphic registers. |
333 If CHARSETn is nil, Gn is never used. | |
334 If CHARSETn is t, Gn can be used but nothing designated initially. | |
335 If CHARSETn is a list of character sets, those character sets are | |
336 designated to Gn on output, but nothing designated to Gn initially. | |
337 SHORT-FORM non-nil means use short designation sequence on output. | |
338 ASCII-EOL non-nil means designate ASCII to g0 at end of line on output. | |
339 ASCII-CNTL non-nil means designate ASCII to g0 before control codes and | |
340 SPACE on output. | |
341 SEVEN non-nil means use 7-bit code only on output. | |
342 LOCKING-SHIFT non-nil means use locking-shift. | |
343 SINGLE-SHIFT non-nil means use single-shift. | |
344 USE-ROMAN non-nil means designate JIS0201-1976-Roman instead of ASCII. | |
345 USE-OLDJIS non-nil means designate JIS0208-1976 instead of JIS0208-1983. | |
346 NO-ISO6429 non-nil means not use ISO6429's direction specification. | |
17094
c237252970e5
(make-coding-system): For ISO-2022 type conding systems,
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
347 INIT-BOL non-nil means any designation state is assumed to be reset |
c237252970e5
(make-coding-system): For ISO-2022 type conding systems,
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
348 to initial at each beginning of line on output. |
c237252970e5
(make-coding-system): For ISO-2022 type conding systems,
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
349 DESIGNATION-BOL non-nil means designation sequences should be placed |
c237252970e5
(make-coding-system): For ISO-2022 type conding systems,
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
350 at beginning of line on output. |
17052 | 351 If TYPE is 4 (private), FLAGS should be a cons of CCL programs, |
352 for encoding and decoding. See the documentation of CCL for more detail." | |
353 | |
354 ;; At first, set a value of `coding-system' property. | |
18298
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
355 (let ((coding-spec (make-vector 5 nil)) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
356 coding-category) |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
357 (if (or (not (integerp type)) (< type 0) (> type 4)) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
358 (error "TYPE argument must be 0..4")) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
359 (if (or (not (integerp mnemonic)) (<= mnemonic ? ) (> mnemonic 127)) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
360 (error "MNEMONIC arguemnt must be a printable character.")) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
361 (aset coding-spec 0 type) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
362 (aset coding-spec 1 mnemonic) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
363 (aset coding-spec 2 (if (stringp doc-string) doc-string "")) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
364 (aset coding-spec 3 nil) ; obsolete element |
18298
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
365 (cond ((= type 0) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
366 (setq coding-category 'coding-category-emacs-mule)) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
367 ((= type 1) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
368 (setq coding-category 'coding-category-sjis)) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
369 ((= type 2) ; ISO2022 |
17052 | 370 (let ((i 0) |
18298
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
371 (vec (make-vector 32 nil)) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
372 (no-initial-designation t) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
373 (g1-designation nil)) |
17052 | 374 (while (< i 4) |
375 (let ((charset (car flags))) | |
18298
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
376 (if (and no-initial-designation |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
377 (> i 0) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
378 (or (charsetp charset) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
379 (and (consp charset) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
380 (charsetp (car charset))))) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
381 (setq no-initial-designation nil)) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
382 (if (charsetp charset) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
383 (if (= i 1) (setq g1-designation charset)) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
384 (if (consp charset) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
385 (let ((tail charset) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
386 elt) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
387 (while tail |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
388 (setq elt (car tail)) |
17094
c237252970e5
(make-coding-system): For ISO-2022 type conding systems,
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
389 (or (not elt) (eq elt t) (charsetp elt) |
c237252970e5
(make-coding-system): For ISO-2022 type conding systems,
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
390 (error "Invalid charset: %s" elt)) |
18298
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
391 (setq tail (cdr tail))) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
392 (setq g1-designation (car charset))) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
393 (if (and charset (not (eq charset t))) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
394 (error "Invalid charset: %s" charset)))) |
17052 | 395 (aset vec i charset)) |
396 (setq flags (cdr flags) i (1+ i))) | |
397 (while (and (< i 32) flags) | |
398 (aset vec i (car flags)) | |
399 (setq flags (cdr flags) i (1+ i))) | |
18298
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
400 (aset coding-spec 4 vec) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
401 (if no-initial-designation |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
402 (put coding-system 'no-initial-designation t)) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
403 (setq coding-category |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
404 (if (aref vec 8) ; Use locking-shift. |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
405 'coding-category-iso-else |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
406 (if (aref vec 7) ; 7-bit only. |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
407 (if (aref vec 9) ; Use single-shift. |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
408 'coding-category-iso-else |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
409 'coding-category-iso-7) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
410 (if no-initial-designation |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
411 'coding-category-iso-else |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
412 (if (and (charsetp g1-designation) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
413 (= (charset-dimension g1-designation) 2)) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
414 'coding-category-iso-8-2 |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
415 'coding-category-iso-8-1))))))) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
416 ((= type 3) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
417 (setq coding-category 'coding-category-big5)) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
418 ((= type 4) ; private |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
419 (setq coding-category 'coding-category-binary) |
17052 | 420 (if (and (consp flags) |
421 (vectorp (car flags)) | |
422 (vectorp (cdr flags))) | |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
423 (aset coding-spec 4 flags) |
18298
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
424 (error "Invalid FLAGS argument for TYPE 4 (CCL)")))) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
425 (put coding-system 'coding-system coding-spec) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
426 (put coding-system 'coding-category coding-category) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
427 (put coding-category 'coding-systems |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
428 (cons coding-system (get coding-category 'coding-systems)))) |
17052 | 429 |
430 ;; Next, set a value of `eol-type' property. The value is a vector | |
18298
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
431 ;; of subsidiary coding systems, each corresponds to a coding system |
17052 | 432 ;; for the detected end-of-line format. |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
433 (put coding-system 'eol-type |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
434 (if (<= type 3) |
18298
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
435 (make-subsidiary-coding-system coding-system) |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
436 0))) |
17052 | 437 |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
438 (defun define-coding-system-alias (coding-system alias) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
439 "Define ALIAS as an alias coding system of CODING-SYSTEM." |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
440 (check-coding-system coding-system) |
18298
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
441 (let ((parent (coding-system-parent coding-system))) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
442 (if parent |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
443 (setq coding-system parent))) |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
444 (put alias 'coding-system coding-system) |
18298
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
445 (put alias 'parent-coding-system coding-system) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
446 (put coding-system 'alias-coding-systems |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
447 (cons alias (get coding-system 'alias-coding-systems))) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
448 (let ((eol-variants (coding-system-eol-type coding-system)) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
449 subsidiaries) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
450 (if (vectorp eol-variants) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
451 (let ((i 0)) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
452 (setq subsidiaries (make-subsidiary-coding-system alias)) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
453 (while (< i 3) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
454 (put (aref subsidiaries i) 'parent-coding-system |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
455 (aref eol-variants i)) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
456 (put (aref eol-variants i) 'alias-coding-systems |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
457 (cons (aref subsidiaries i) (get (aref eol-variants i) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
458 'alias-coding-systems))) |
3d036a21fc93
(coding-system-type): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
18195
diff
changeset
|
459 (setq i (1+ i))))))) |
17052 | 460 |
461 (defun set-buffer-file-coding-system (coding-system &optional force) | |
462 "Set buffer-file-coding-system of the current buffer to CODING-SYSTEM. | |
463 If eol-type of the current buffer-file-coding-system is an integer value N, and | |
17761
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
464 eol-type of CODING-SYSTEM is a vector, the Nth element of the vector is used |
17052 | 465 instead of CODING-SYSTEM itself. |
466 Optional prefix argument FORCE non-nil means CODING-SYSTEM is set | |
467 regardless of eol-type of the current buffer-file-coding-system." | |
468 (interactive "zBuffer-file-coding-system: \nP") | |
469 (check-coding-system coding-system) | |
470 (if (null force) | |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
471 (let ((x (coding-system-eol-type buffer-file-coding-system)) |
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
472 (y (coding-system-eol-type coding-system))) |
17052 | 473 (if (and (numberp x) (>= x 0) (<= x 2) (vectorp y)) |
474 (setq coding-system (aref y x))))) | |
475 (setq buffer-file-coding-system coding-system) | |
476 (set-buffer-modified-p t) | |
477 (force-mode-line-update)) | |
478 | |
17984
4882d58acf01
(set-terminal-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
17837
diff
changeset
|
479 (defun set-terminal-coding-system (coding-system) |
4882d58acf01
(set-terminal-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
17837
diff
changeset
|
480 "Set coding system of your terminal to CODING-SYSTEM. |
4882d58acf01
(set-terminal-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
17837
diff
changeset
|
481 All outputs to terminal are encoded by the specified coding system." |
4882d58acf01
(set-terminal-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
17837
diff
changeset
|
482 (interactive "zCoding-system for terminal display: ") |
4882d58acf01
(set-terminal-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
17837
diff
changeset
|
483 (set-terminal-coding-system-internal coding-system) |
4882d58acf01
(set-terminal-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
17837
diff
changeset
|
484 (redraw-frame (selected-frame))) |
4882d58acf01
(set-terminal-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
17837
diff
changeset
|
485 |
4882d58acf01
(set-terminal-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
17837
diff
changeset
|
486 (defun set-keyboard-coding-system (coding-system) |
4882d58acf01
(set-terminal-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
17837
diff
changeset
|
487 "Set coding system of codes sent from terminal keyboard to CODING-SYSTEM. |
4882d58acf01
(set-terminal-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
17837
diff
changeset
|
488 In addition, this command toggles Encoded-kbd minor mode. |
4882d58acf01
(set-terminal-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
17837
diff
changeset
|
489 If the specified coding system is nil, Encoded-bkd mode is turned off, |
4882d58acf01
(set-terminal-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
17837
diff
changeset
|
490 else it is turned on so that user inputs are decoded by the |
4882d58acf01
(set-terminal-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
17837
diff
changeset
|
491 specified coding system." |
4882d58acf01
(set-terminal-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
17837
diff
changeset
|
492 (interactive "zCoding-system for keyboard input: ") |
4882d58acf01
(set-terminal-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
17837
diff
changeset
|
493 (set-keyboard-coding-system-internal coding-system) |
4882d58acf01
(set-terminal-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
17837
diff
changeset
|
494 (encoded-kbd-mode (if coding-system 1 0))) |
4882d58acf01
(set-terminal-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
17837
diff
changeset
|
495 |
4882d58acf01
(set-terminal-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
17837
diff
changeset
|
496 (defun set-buffer-process-coding-system (decoding encoding) |
4882d58acf01
(set-terminal-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
17837
diff
changeset
|
497 "Set coding systems to the process associated with the current buffer. |
4882d58acf01
(set-terminal-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
17837
diff
changeset
|
498 DECODING is the coding system to be used to decode input from the process, |
4882d58acf01
(set-terminal-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
17837
diff
changeset
|
499 ENCODING is to be used to encode output to the process." |
17052 | 500 (interactive |
501 "zCoding-system for process input: \nzCoding-system for process output: ") | |
502 (let ((proc (get-buffer-process (current-buffer)))) | |
503 (if (null proc) | |
504 (error "no process") | |
17984
4882d58acf01
(set-terminal-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
17837
diff
changeset
|
505 (check-coding-system decoding) |
4882d58acf01
(set-terminal-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
17837
diff
changeset
|
506 (check-coding-system encoding) |
4882d58acf01
(set-terminal-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
17837
diff
changeset
|
507 (set-process-coding-system proc decoding encoding))) |
17052 | 508 (force-mode-line-update)) |
509 | |
510 (defun set-coding-priority (arg) | |
511 "Set priority of coding-category according to LIST. | |
512 LIST is a list of coding-categories ordered by priority." | |
513 (let (l) | |
514 ;; Put coding-categories listed in ARG to L while checking the | |
515 ;; validity. We assume that `coding-category-list' contains whole | |
516 ;; coding-categories. | |
517 (while arg | |
518 (if (null (memq (car arg) coding-category-list)) | |
519 (error "Invalid element in argument: %s" (car arg))) | |
520 (setq l (cons (car arg) l)) | |
521 (setq arg (cdr arg))) | |
522 ;; Put coding-category not listed in ARG to L. | |
523 (while coding-category-list | |
524 (if (null (memq (car coding-category-list) l)) | |
525 (setq l (cons (car coding-category-list) l))) | |
526 (setq coding-category-list (cdr coding-category-list))) | |
527 ;; Update `coding-category-list' and return it. | |
528 (setq coding-category-list (nreverse l)))) | |
529 | |
530 ;;; FILE I/O | |
531 | |
532 ;; Set buffer-file-coding-system of the current buffer after some text | |
533 ;; is inserted. | |
534 (defun after-insert-file-set-buffer-file-coding-system (inserted) | |
535 (if last-coding-system-used | |
536 (let ((coding-system | |
537 (find-new-buffer-file-coding-system last-coding-system-used)) | |
538 (modified-p (buffer-modified-p))) | |
539 (if coding-system | |
540 (set-buffer-file-coding-system coding-system)) | |
541 (set-buffer-modified-p modified-p))) | |
542 nil) | |
543 | |
544 (setq after-insert-file-functions | |
545 (cons 'after-insert-file-set-buffer-file-coding-system | |
546 after-insert-file-functions)) | |
547 | |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
548 ;; The coding-spec and eol-type of coding-system returned is decided |
17052 | 549 ;; independently in the following order. |
550 ;; 1. That of buffer-file-coding-system locally bound. | |
551 ;; 2. That of CODING. | |
552 | |
553 (defun find-new-buffer-file-coding-system (coding) | |
554 "Return a coding system for a buffer when a file of CODING is inserted. | |
17761
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
555 The local variable `buffer-file-coding-system' of the current buffer |
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
556 is set to the returned value. |
17984
4882d58acf01
(set-terminal-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
17837
diff
changeset
|
557 Return nil if there's no need of setting new buffer-file-coding-system." |
17052 | 558 (let (local-coding local-eol |
559 found-eol | |
560 new-coding new-eol) | |
561 (if (null coding) | |
562 ;; Nothing found about coding. | |
563 nil | |
564 | |
565 ;; Get information of the current local value of | |
566 ;; `buffer-file-coding-system' in LOCAL-EOL and LOCAL-CODING. | |
567 (if (local-variable-p 'buffer-file-coding-system) | |
568 ;; Something already set locally. | |
569 (progn | |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
570 (setq local-eol (coding-system-eol-type buffer-file-coding-system)) |
17052 | 571 (if (null (numberp local-eol)) |
572 ;; But eol-type is not yet set. | |
573 (setq local-eol nil)) | |
574 (if (null (eq (coding-system-type buffer-file-coding-system) t)) | |
17837
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
575 ;; This is not `undecided'. |
17052 | 576 (progn |
577 (setq local-coding buffer-file-coding-system) | |
578 (while (symbolp (get local-coding 'coding-system)) | |
579 (setq local-coding (get local-coding 'coding-system)))) | |
580 ))) | |
581 | |
582 (if (and local-eol local-coding) | |
583 ;; The current buffer has already set full coding-system, we | |
584 ;; had better not change it. | |
585 nil | |
586 | |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
587 (setq found-eol (coding-system-eol-type coding)) |
17052 | 588 (if (null (numberp found-eol)) |
589 ;; But eol-type is not found. | |
590 (setq found-eol nil)) | |
591 (if (eq (coding-system-type coding) t) | |
17837
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
592 ;; This is `undecided', which means nothing found except |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
593 ;; for eol-type. |
17052 | 594 (setq coding nil)) |
595 | |
596 ;; The local setting takes precedence over the found one. | |
597 (setq new-coding (or local-coding coding)) | |
598 (setq new-eol (or local-eol found-eol)) | |
599 (if (and (numberp new-eol) | |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
600 (vectorp (coding-system-eol-type new-coding))) |
17052 | 601 (setq new-coding |
18195
9650375d0a68
Delete declaration for buffer-file-coding-system. It
Kenichi Handa <handa@m17n.org>
parents:
17984
diff
changeset
|
602 (aref (coding-system-eol-type new-coding) new-eol))) |
17052 | 603 new-coding)))) |
604 | |
17761
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
605 (defun make-unification-table (&rest args) |
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
606 "Make a unification table (char table) from arguments. |
17837
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
607 Each argument is a list of the form (FROM . TO), |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
608 where FROM is a character to be unified to TO. |
17761
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
609 |
17837
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
610 FROM can be a generic character (see make-char). In this case, TO is |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
611 a generic character containing the same number of charcters or a |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
612 oridinal character. If FROM and TO are both generic characters, all |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
613 characters belonging to FROM are unified to characters belonging to TO |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
614 without changing their position code(s)." |
17761
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
615 (let ((table (make-char-table 'character-unification-table)) |
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
616 revlist) |
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
617 (while args |
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
618 (let ((elts (car args))) |
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
619 (while elts |
17837
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
620 (let* ((from (car (car elts))) |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
621 (from-i 0) ; degree of freedom of FROM |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
622 (from-rev (nreverse (split-char from))) |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
623 (to (cdr (car elts))) |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
624 (to-i 0) ; degree of freedom of TO |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
625 (to-rev (nreverse (split-char to)))) |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
626 ;; Check numbers of heading 0s in FROM-REV and TO-REV. |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
627 (while (eq (car from-rev) 0) |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
628 (setq from-i (1+ from-i) from-rev (cdr from-rev))) |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
629 (while (eq (car to-rev) 0) |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
630 (setq to-i (1+ to-i) to-rev (cdr to-rev))) |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
631 (if (and (/= from-i to-i) (/= to-i 0)) |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
632 (error "Invalid character pair (%d . %d)" from to)) |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
633 ;; If we have already unified TO to TO-ALT, FROM should |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
634 ;; also be unified to TO-ALT. But, this is only if TO is |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
635 ;; a generic character or TO-ALT is not a generic |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
636 ;; character. |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
637 (let ((to-alt (aref table to))) |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
638 (if (and to-alt |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
639 (or (> to-i 0) (not (generic-char-p to-alt)))) |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
640 (setq to to-alt))) |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
641 (if (> from-i 0) |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
642 (set-char-table-default table from to) |
a4d3078a83e9
(make-unification-table): Fix handling of a generic
Kenichi Handa <handa@m17n.org>
parents:
17761
diff
changeset
|
643 (aset table from to)) |
17761
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
644 ;; If we have already unified some chars to FROM, they |
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
645 ;; should also be unified to TO. |
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
646 (let ((l (assq from revlist))) |
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
647 (if l |
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
648 (let ((ch (car l))) |
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
649 (setcar l to) |
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
650 (setq l (cdr l)) |
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
651 (while l |
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
652 (aset table ch to) |
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
653 (setq l (cdr l)) )))) |
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
654 ;; Now update REVLIST. |
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
655 (let ((l (assq to revlist))) |
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
656 (if l |
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
657 (setcdr l (cons from (cdr l))) |
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
658 (setq revlist (cons (list to from) revlist))))) |
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
659 (setq elts (cdr elts)))) |
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
660 (setq args (cdr args))) |
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
661 ;; Return TABLE just created. |
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
662 table)) |
c5f430853301
(make-char): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
17175
diff
changeset
|
663 |
17094
c237252970e5
(make-coding-system): For ISO-2022 type conding systems,
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
664 ;;; Initialize some variables. |
c237252970e5
(make-coding-system): For ISO-2022 type conding systems,
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
665 |
c237252970e5
(make-coding-system): For ISO-2022 type conding systems,
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
666 (put 'use-default-ascent 'char-table-extra-slots 0) |
c237252970e5
(make-coding-system): For ISO-2022 type conding systems,
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
667 (setq use-default-ascent (make-char-table 'use-default-ascent)) |
c237252970e5
(make-coding-system): For ISO-2022 type conding systems,
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
668 |
c237252970e5
(make-coding-system): For ISO-2022 type conding systems,
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
669 ;;; |
17052 | 670 (provide 'mule) |
671 | |
672 ;;; mule.el ends here |