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