aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-09-05 05:43:29 +0000
committerRichard M. Stallman1997-09-05 05:43:29 +0000
commit2e02a76fcc874a63f6457a12ca5a68e42905747d (patch)
tree03674aeda37a7795ef9f957fa153ba78b3433aec
parent024d8713bc697015a1299386aeb337cbd3b31302 (diff)
downloademacs-2e02a76fcc874a63f6457a12ca5a68e42905747d.tar.gz
emacs-2e02a76fcc874a63f6457a12ca5a68e42905747d.zip
(charset-quoted-standard-p): New function.
Use it instead of quoted-symbol-p. (charset-id): Use charset-quoted-standard-p. (quoted-symbol-p): Function deleted. (set-terminal-coding-system): Specify default to read-coding-system. (set-keyboard-coding-system): Likewise.
-rw-r--r--lisp/international/mule.el63
1 files changed, 36 insertions, 27 deletions
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index e00a7f5ac35..09a8bc7283b 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -75,9 +75,14 @@ Return t if file exists."
75 75
76;; API (Application Program Interface) for charsets. 76;; API (Application Program Interface) for charsets.
77 77
78;; Return t if OBJ is a quoted symbol. 78;; Return t if OBJ is a quoted symbol
79(defsubst quoted-symbol-p (obj) 79;; and the symbol is the name of a standard charset.
80 (and (listp obj) (eq (car obj) 'quote))) 80(defsubst charset-quoted-standard-p (obj)
81 (and (listp obj) (eq (car obj) 'quote)
82 (symbolp (car-safe (cdr obj)))
83 (let ((vector (get (car-safe (cdr obj)) 'charset)))
84 (and (vectorp vector)
85 (< (aref vector 0) 160)))))
81 86
82(defsubst charsetp (object) 87(defsubst charsetp (object)
83 "T is OBJECT is a charset." 88 "T is OBJECT is a charset."
@@ -125,91 +130,91 @@ PLIST (property list) may contain any type of information a user
125 130
126(defmacro charset-id (charset) 131(defmacro charset-id (charset)
127 "Return charset identification number of CHARSET." 132 "Return charset identification number of CHARSET."
128 (if (and (listp charset) (eq (car charset) 'quote)) 133 (if (charset-quoted-standard-p charset)
129 (aref (charset-info (nth 1 charset)) 0) 134 (aref (charset-info (nth 1 charset)) 0)
130 `(aref (charset-info ,charset) 0))) 135 `(aref (charset-info ,charset) 0)))
131 136
132(defmacro charset-bytes (charset) 137(defmacro charset-bytes (charset)
133 "Return bytes of CHARSET. 138 "Return bytes of CHARSET.
134See the function `charset-info' for more detail." 139See the function `charset-info' for more detail."
135 (if (quoted-symbol-p charset) 140 (if (charset-quoted-standard-p charset)
136 (aref (charset-info (nth 1 charset)) 1) 141 (aref (charset-info (nth 1 charset)) 1)
137 `(aref (charset-info ,charset) 1))) 142 `(aref (charset-info ,charset) 1)))
138 143
139(defmacro charset-dimension (charset) 144(defmacro charset-dimension (charset)
140 "Return dimension of CHARSET. 145 "Return dimension of CHARSET.
141See the function `charset-info' for more detail." 146See the function `charset-info' for more detail."
142 (if (quoted-symbol-p charset) 147 (if (charset-quoted-standard-p charset)
143 (aref (charset-info (nth 1 charset)) 2) 148 (aref (charset-info (nth 1 charset)) 2)
144 `(aref (charset-info ,charset) 2))) 149 `(aref (charset-info ,charset) 2)))
145 150
146(defmacro charset-chars (charset) 151(defmacro charset-chars (charset)
147 "Return character numbers contained in a dimension of CHARSET. 152 "Return character numbers contained in a dimension of CHARSET.
148See the function `charset-info' for more detail." 153See the function `charset-info' for more detail."
149 (if (quoted-symbol-p charset) 154 (if (charset-quoted-standard-p charset)
150 (aref (charset-info (nth 1 charset)) 3) 155 (aref (charset-info (nth 1 charset)) 3)
151 `(aref (charset-info ,charset) 3))) 156 `(aref (charset-info ,charset) 3)))
152 157
153(defmacro charset-width (charset) 158(defmacro charset-width (charset)
154 "Return width (how many column occupied on a screen) of CHARSET. 159 "Return width (how many column occupied on a screen) of CHARSET.
155See the function `charset-info' for more detail." 160See the function `charset-info' for more detail."
156 (if (quoted-symbol-p charset) 161 (if (charset-quoted-standard-p charset)
157 (aref (charset-info (nth 1 charset)) 4) 162 (aref (charset-info (nth 1 charset)) 4)
158 `(aref (charset-info ,charset) 4))) 163 `(aref (charset-info ,charset) 4)))
159 164
160(defmacro charset-direction (charset) 165(defmacro charset-direction (charset)
161 "Return direction of CHARSET. 166 "Return direction of CHARSET.
162See the function `charset-info' for more detail." 167See the function `charset-info' for more detail."
163 (if (quoted-symbol-p charset) 168 (if (charset-quoted-standard-p charset)
164 (aref (charset-info (nth 1 charset)) 5) 169 (aref (charset-info (nth 1 charset)) 5)
165 `(aref (charset-info ,charset) 5))) 170 `(aref (charset-info ,charset) 5)))
166 171
167(defmacro charset-iso-final-char (charset) 172(defmacro charset-iso-final-char (charset)
168 "Return final char of CHARSET. 173 "Return final char of CHARSET.
169See the function `charset-info' for more detail." 174See the function `charset-info' for more detail."
170 (if (quoted-symbol-p charset) 175 (if (charset-quoted-standard-p charset)
171 (aref (charset-info (nth 1 charset)) 8) 176 (aref (charset-info (nth 1 charset)) 8)
172 `(aref (charset-info ,charset) 8))) 177 `(aref (charset-info ,charset) 8)))
173 178
174(defmacro charset-iso-graphic-plane (charset) 179(defmacro charset-iso-graphic-plane (charset)
175 "Return graphic plane of CHARSET. 180 "Return graphic plane of CHARSET.
176See the function `charset-info' for more detail." 181See the function `charset-info' for more detail."
177 (if (quoted-symbol-p charset) 182 (if (charset-quoted-standard-p charset)
178 (aref (charset-info (nth 1 charset)) 9) 183 (aref (charset-info (nth 1 charset)) 9)
179 `(aref (charset-info ,charset) 9))) 184 `(aref (charset-info ,charset) 9)))
180 185
181(defmacro charset-reverse-charset (charset) 186(defmacro charset-reverse-charset (charset)
182 "Return reverse charset of CHARSET. 187 "Return reverse charset of CHARSET.
183See the function `charset-info' for more detail." 188See the function `charset-info' for more detail."
184 (if (quoted-symbol-p charset) 189 (if (charset-quoted-standard-p charset)
185 (aref (charset-info (nth 1 charset)) 10) 190 (aref (charset-info (nth 1 charset)) 10)
186 `(aref (charset-info ,charset) 10))) 191 `(aref (charset-info ,charset) 10)))
187 192
188(defmacro charset-short-name (charset) 193(defmacro charset-short-name (charset)
189 "Return short name of CHARSET. 194 "Return short name of CHARSET.
190See the function `charset-info' for more detail." 195See the function `charset-info' for more detail."
191 (if (quoted-symbol-p charset) 196 (if (charset-quoted-standard-p charset)
192 (aref (charset-info (nth 1 charset)) 11) 197 (aref (charset-info (nth 1 charset)) 11)
193 `(aref (charset-info ,charset) 11))) 198 `(aref (charset-info ,charset) 11)))
194 199
195(defmacro charset-long-name (charset) 200(defmacro charset-long-name (charset)
196 "Return long name of CHARSET. 201 "Return long name of CHARSET.
197See the function `charset-info' for more detail." 202See the function `charset-info' for more detail."
198 (if (quoted-symbol-p charset) 203 (if (charset-quoted-standard-p charset)
199 (aref (charset-info (nth 1 charset)) 12) 204 (aref (charset-info (nth 1 charset)) 12)
200 `(aref (charset-info ,charset) 12))) 205 `(aref (charset-info ,charset) 12)))
201 206
202(defmacro charset-description (charset) 207(defmacro charset-description (charset)
203 "Return descriptoin of CHARSET. 208 "Return descriptoin of CHARSET.
204See the function `charset-info' for more detail." 209See the function `charset-info' for more detail."
205 (if (quoted-symbol-p charset) 210 (if (charset-quoted-standard-p charset)
206 (aref (charset-info (nth 1 charset)) 13) 211 (aref (charset-info (nth 1 charset)) 13)
207 `(aref (charset-info ,charset) 13))) 212 `(aref (charset-info ,charset) 13)))
208 213
209(defmacro charset-plist (charset) 214(defmacro charset-plist (charset)
210 "Return list charset property of CHARSET. 215 "Return list charset property of CHARSET.
211See the function `charset-info' for more detail." 216See the function `charset-info' for more detail."
212 (if (quoted-symbol-p charset) 217 (if (charset-quoted-standard-p charset)
213 `(aref ,(charset-info (nth 1 charset)) 14) 218 `(aref ,(charset-info (nth 1 charset)) 14)
214 `(aref (charset-info ,charset) 14))) 219 `(aref (charset-info ,charset) 14)))
215 220
@@ -223,7 +228,7 @@ CODE1 and CODE2 are optional, but if you don't supply
223sufficient position-codes, return a generic character which stands for 228sufficient position-codes, return a generic character which stands for
224all characters or group of characters in the character sets. 229all characters or group of characters in the character sets.
225A generic character can be used to index a char table (e.g. syntax-table)." 230A generic character can be used to index a char table (e.g. syntax-table)."
226 (if (quoted-symbol-p charset) 231 (if (charset-quoted-standard-p charset)
227 `(make-char-internal ,(charset-id (nth 1 charset)) ,c1 ,c2) 232 `(make-char-internal ,(charset-id (nth 1 charset)) ,c1 ,c2)
228 `(make-char-internal (charset-id ,charset) ,c1 ,c2))) 233 `(make-char-internal (charset-id ,charset) ,c1 ,c2)))
229 234
@@ -536,11 +541,13 @@ For a list of possible values of CODING-SYSTEM, use \\[list-coding-systems].
536The default is determined by the selected language environment 541The default is determined by the selected language environment
537or by the previous use of this command." 542or by the previous use of this command."
538 (interactive 543 (interactive
539 (list (read-coding-system 544 (list (let ((default (if (and (not (terminal-coding-system))
540 (format "Coding system for terminal display (default, %s): " 545 default-terminal-coding-system)
541 (if (and (not (terminal-coding-system)) 546 default-terminal-coding-system)))
542 default-terminal-coding-system) 547 (read-coding-system
543 default-terminal-coding-system))))) 548 (format "Coding system for terminal display (default, %s): "
549 default)
550 default))))
544 (if (and (not coding-system) 551 (if (and (not coding-system)
545 (not (terminal-coding-system))) 552 (not (terminal-coding-system)))
546 (setq coding-system default-terminal-coding-system)) 553 (setq coding-system default-terminal-coding-system))
@@ -562,11 +569,13 @@ For a list of possible values of CODING-SYSTEM, use \\[list-coding-systems].
562The default is determined by the selected language environment 569The default is determined by the selected language environment
563or by the previous use of this command." 570or by the previous use of this command."
564 (interactive 571 (interactive
565 (list (read-coding-system 572 (list (let ((default (if (and (not (keyboard-coding-system))
566 (format "Coding system for keyboard input (default, %s): " 573 default-keyboard-coding-system)
567 (if (and (not (keyboard-coding-system)) 574 default-keyboard-coding-system)))
568 default-keyboard-coding-system) 575 (read-coding-system
569 default-keyboard-coding-system))))) 576 (format "Coding system for keyboard input (default, %s): "
577 default)
578 default))))
570 (if (and (not coding-system) 579 (if (and (not coding-system)
571 (not (keyboard-coding-system))) 580 (not (keyboard-coding-system)))
572 (setq coding-system default-keyboard-coding-system)) 581 (setq coding-system default-keyboard-coding-system))