1 |
;;; mule.el --- basic commands for mulitilingual environment |
;;; mule.el --- basic commands for multilingual environment |
2 |
|
|
3 |
;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. |
;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. |
4 |
;; Licensed to the Free Software Foundation. |
;; Licensed to the Free Software Foundation. |
48 |
(defun define-charset (name docstring &rest props) |
(defun define-charset (name docstring &rest props) |
49 |
"Define NAME (symbol) as a charset with DOCSTRING. |
"Define NAME (symbol) as a charset with DOCSTRING. |
50 |
The remaining arguments must come in pairs ATTRIBUTE VALUE. ATTRIBUTE |
The remaining arguments must come in pairs ATTRIBUTE VALUE. ATTRIBUTE |
51 |
may be any symbol. The followings have special meanings, and one of |
may be any symbol. The following have special meanings, and one of |
52 |
`:code-offset', `:map', `:parents' must be specified. |
`:code-offset', `:map', `:parents' must be specified. |
53 |
|
|
54 |
`:short-name' |
`:short-name' |
59 |
`:long-name' |
`:long-name' |
60 |
|
|
61 |
VALUE must be a string longer than `:short-name' to identify the |
VALUE must be a string longer than `:short-name' to identify the |
62 |
charset. If omitted, the value of `:short-name' attribute is used. |
charset. If omitted, the value of the `:short-name' attribute is used. |
63 |
|
|
64 |
`:dimension' |
`:dimension' |
65 |
|
|
66 |
VALUE must be an integer 0, 1, 2, or 3, specifying the dimension of |
VALUE must be an integer 0, 1, 2, or 3, specifying the dimension of |
67 |
code-points of the charsets. If omitted, it is calculated from a |
code-points of the charsets. If omitted, it is calculated from the |
68 |
value of `:code-space' attribute. |
value of the `:code-space' attribute. |
69 |
|
|
70 |
`:code-space' |
`:code-space' |
71 |
|
|
72 |
VALUE must be a vector of length at most 8 specifying the byte code |
VALUE must be a vector of length at most 8 specifying the byte code |
73 |
range of each dimension in this format: |
range of each dimension in this format: |
74 |
[ MIN-1 MAX-1 MIN-2 MAX-2 ... ] |
[ MIN-1 MAX-1 MIN-2 MAX-2 ... ] |
75 |
where, MIN-N is the minimum byte value of Nth dimension of code-point, |
where MIN-N is the minimum byte value of Nth dimension of code-point, |
76 |
MAX-N is the maximum byte value of that. |
MAX-N is the maximum byte value of that. |
77 |
|
|
78 |
`:iso-final-char' |
`:iso-final-char' |
94 |
|
|
95 |
`:ascii-compatible-p' |
`:ascii-compatible-p' |
96 |
|
|
97 |
VALUE must be nil or t. If the VALUE is nil, the charset is a not |
VALUE must be nil or t (default nil). If VALUE is t, the charset is |
98 |
compatible with ASCII. The default value is nil. |
compatible with ASCII, i.e. the first 128 code points map to ASCII. |
99 |
|
|
100 |
`:supplementary-p' |
`:supplementary-p' |
101 |
|
|
102 |
VALUE must be nil or t. If the VALUE is t, the charset is |
VALUE must be nil or t. If the VALUE is t, the charset is |
103 |
supplementary, which means the charset is used only as a parent of |
supplementary, which means it is used only as a parent of some other |
104 |
some other charset. |
charset. |
105 |
|
|
106 |
`:invalid-code' |
`:invalid-code' |
107 |
|
|
112 |
|
|
113 |
`:code-offset' |
`:code-offset' |
114 |
|
|
115 |
VALUE must be an integer added to an index number of character to get |
VALUE must be an integer added to the index number of a character to |
116 |
the corresponding character code. |
get the corresponding character code. |
117 |
|
|
118 |
`:map' |
`:map' |
119 |
|
|
121 |
|
|
122 |
If it is a vector, the format is [ CODE-1 CHAR-1 CODE-2 CHAR-2 ... ], |
If it is a vector, the format is [ CODE-1 CHAR-1 CODE-2 CHAR-2 ... ], |
123 |
where CODE-n is a code-point of the charset, and CHAR-n is the |
where CODE-n is a code-point of the charset, and CHAR-n is the |
124 |
corresponding charcter code. |
corresponding character code. |
125 |
|
|
126 |
If it is a string, it is a name of file that contains the above |
If it is a string, it is a name of file that contains the above |
127 |
information. Each line of the file must be this format: |
information. Each line of the file must be this format: |
144 |
|
|
145 |
If it is a vector, the format is [ CODE-1 CHAR-1 CODE-2 CHAR-2 ... ], |
If it is a vector, the format is [ CODE-1 CHAR-1 CODE-2 CHAR-2 ... ], |
146 |
where CODE-n is a code-point of the charset, and CHAR-n is the |
where CODE-n is a code-point of the charset, and CHAR-n is the |
147 |
corresponding Unicode charcter code. |
corresponding Unicode character code. |
148 |
|
|
149 |
If it is a string, it is a name of file that contains the above |
If it is a string, it is a name of file that contains the above |
150 |
information. The file format is the same as what described for `:map' |
information. The file format is the same as what described for `:map' |
311 |
This function is provided for backward compatibility. |
This function is provided for backward compatibility. |
312 |
Now we have the variable `charset-list'." |
Now we have the variable `charset-list'." |
313 |
charset-list) |
charset-list) |
314 |
|
(make-obsolete 'charset-list "Use variable `charset-list'" "22.1") |
315 |
|
|
316 |
(defun generic-char-p (char) |
(defun generic-char-p (char) |
317 |
"Always return nil. This exists only for backward compatibility." |
"Always return nil. This exists only for backward compatibility." |
318 |
nil) |
nil) |
319 |
|
(make-obsolete 'generic-char-p "Generic characters no longer exist" "22.1") |
320 |
|
|
321 |
;; Coding system stuff |
;; Coding system stuff |
322 |
|
|
430 |
`:ascii-compatible-p' (optional) |
`:ascii-compatible-p' (optional) |
431 |
|
|
432 |
If VALUE is non-nil, the coding system decodes all 7-bit bytes into |
If VALUE is non-nil, the coding system decodes all 7-bit bytes into |
433 |
the correponding ASCII characters, and encodes all ASCII characters |
the corresponding ASCII characters, and encodes all ASCII characters |
434 |
back to the correponding 7-bit bytes. If omitted, the VALUE defaults |
back to the corresponding 7-bit bytes. If omitted, the VALUE defaults |
435 |
to nil. |
to nil. |
436 |
|
|
437 |
`:decode-translation-table' (optional) |
`:decode-translation-table' (optional) |
490 |
|
|
491 |
If it is nil, no charset can be designated to GN. |
If it is nil, no charset can be designated to GN. |
492 |
|
|
493 |
If it is a charset, the charset is initially designaged to GN, and |
If it is a charset, the charset is initially designated to GN, and |
494 |
never used by the other charsets. |
never used by the other charsets. |
495 |
|
|
496 |
If it is a list, the elements must be charsets, nil, 94, or 96. GN |
If it is a list, the elements must be charsets, nil, 94, or 96. GN |
497 |
can be used by all listed charsets. If the list contains 94, any |
can be used by all listed charsets. If the list contains 94, any |
498 |
charsets whose iso-chars is 94 can be designaged to GN. If the list |
charsets whose iso-chars is 94 can be designated to GN. If the list |
499 |
contains 96, any charsets whose iso-chars is 96 can be designaged to |
contains 96, any charsets whose iso-chars is 96 can be designated to |
500 |
GN. If the first element is a charset, the charset is initially |
GN. If the first element is a charset, the charset is initially |
501 |
designaged to GN. |
designated to GN. |
502 |
|
|
503 |
This attribute has a meaning only when `:coding-type' is `iso-2022'. |
This attribute has a meaning only when `:coding-type' is `iso-2022'. |
504 |
|
|
618 |
(plist-get (coding-system-plist coding-system) :coding-type)) |
(plist-get (coding-system-plist coding-system) :coding-type)) |
619 |
|
|
620 |
(defun coding-system-charset-list (coding-system) |
(defun coding-system-charset-list (coding-system) |
621 |
"Return list of charsets supported by COIDNG-SYSTEM. |
"Return list of charsets supported by CODING-SYSTEM. |
622 |
If CODING-SYSTEM supports all ISO-2022 charsets, return `iso-2022'. |
If CODING-SYSTEM supports all ISO-2022 charsets, return `iso-2022'. |
623 |
If CODING-SYSTEM supports all emacs-mule charsets, return `emacs-mule'." |
If CODING-SYSTEM supports all emacs-mule charsets, return `emacs-mule'." |
624 |
(plist-get (coding-system-plist coding-system) :charset-list)) |
(plist-get (coding-system-plist coding-system) :charset-list)) |
625 |
|
|
626 |
(defun coding-system-get (coding-system prop) |
(defun coding-system-get (coding-system prop) |
627 |
"Extract a value from CODING-SYSTEM's property list for property PROP." |
"Extract a value from CODING-SYSTEM's property list for property PROP. |
628 |
(plist-get (coding-system-plist coding-system) prop)) |
For compatibility with Emacs 20/21, this accepts old-style symbols |
629 |
|
like `mime-charset' as well as the current style like `:mime-charset'." |
630 |
|
(or (plist-get (coding-system-plist coding-system) prop) |
631 |
|
(if (not (keywordp prop)) |
632 |
|
(plist-get (coding-system-plist coding-system) |
633 |
|
(intern (concat ":" (symbol-name prop))))))) |
634 |
|
|
635 |
(defun coding-system-put (coding-system prop val) |
(defun coding-system-put (coding-system prop val) |
636 |
"Change value in CODING-SYSTEM's property list PROP to VAL." |
"Change value in CODING-SYSTEM's property list PROP to VAL." |
884 |
(setq l (cdr l))) |
(setq l (cdr l))) |
885 |
;; Update `coding-category-list' and return it. |
;; Update `coding-category-list' and return it. |
886 |
(setq coding-category-list (append arg current-list)) |
(setq coding-category-list (append arg current-list)) |
887 |
|
;; Fixme: not defined. |
888 |
(set-coding-priority-internal))) |
(set-coding-priority-internal))) |
889 |
|
(make-obsolete 'set-coding-priority 'set-coding-system-priority "22.1") |
890 |
|
|
891 |
;;; X selections |
;;; X selections |
892 |
|
|
1486 |
(put 'with-category-table 'lisp-indent-function 1) |
(put 'with-category-table 'lisp-indent-function 1) |
1487 |
|
|
1488 |
(defmacro with-category-table (category-table &rest body) |
(defmacro with-category-table (category-table &rest body) |
1489 |
|
"Execute BODY like `progn' with CATEGORY-TABLE the current category table." |
1490 |
`(let ((current-category-table (category-table))) |
`(let ((current-category-table (category-table))) |
1491 |
(set-category-table ,category-table) |
(set-category-table ,category-table) |
1492 |
(unwind-protect |
(unwind-protect |