comparison lisp/international/mule.el @ 19985:930e7515c033

(charset-list): Change it to function. Make it obsolete. (make-coding-system): Put `coding-system-parent' property to a coding system just made. (coding-spec-plist-idx): New variable.
author Kenichi Handa <handa@m17n.org>
date Thu, 25 Sep 1997 12:26:38 +0000
parents 46e5df654a35
children cc81b9c8ae20
comparison
equal deleted inserted replaced
19984:2195c8746e05 19985:930e7515c033
228 A generic character can be used to index a char table (e.g. syntax-table)." 228 A generic character can be used to index a char table (e.g. syntax-table)."
229 (if (charset-quoted-standard-p charset) 229 (if (charset-quoted-standard-p charset)
230 `(make-char-internal ,(charset-id (nth 1 charset)) ,c1 ,c2) 230 `(make-char-internal ,(charset-id (nth 1 charset)) ,c1 ,c2)
231 `(make-char-internal (charset-id ,charset) ,c1 ,c2))) 231 `(make-char-internal (charset-id ,charset) ,c1 ,c2)))
232 232
233 (defmacro charset-list () 233 (defun charset-list ()
234 "Return list of charsets ever defined. 234 "Return list of charsets ever defined.
235 235
236 This macro is provided for backward compatibility. 236 This function is provided for backward compatibility.
237 Now we have the variable `charset-list'." 237 Now we have the variable `charset-list'."
238 'charset-list) 238 charset-list)
239
240 (make-obsolete 'charset-list
241 "Use the variable charset-list instead.")
239 242
240 (defsubst generic-char-p (char) 243 (defsubst generic-char-p (char)
241 "Return t if and only if CHAR is a generic character. 244 "Return t if and only if CHAR is a generic character.
242 See also the documentation of make-char." 245 See also the documentation of make-char."
243 (let ((l (split-char char))) 246 (let ((l (split-char char)))
248 251
249 ;; Coding system is a symbol that has the property `coding-system'. 252 ;; Coding system is a symbol that has the property `coding-system'.
250 ;; 253 ;;
251 ;; The value of the property `coding-system' is a vector of the 254 ;; The value of the property `coding-system' is a vector of the
252 ;; following format: 255 ;; following format:
253 ;; [TYPE MNEMONIC DOC-STRING NOT-USED-NOW FLAGS] 256 ;; [TYPE MNEMONIC DOC-STRING PLIST FLAGS]
254 ;; We call this vector as coding-spec. See comments in src/coding.c 257 ;; We call this vector as coding-spec. See comments in src/coding.c
255 ;; for more detail. The property value may be another coding system, 258 ;; for more detail.
256 ;; in which case, the coding-spec should be taken from that
257 ;; coding-system. The 4th element NOT-USED-NOW is kept just for
258 ;; backward compatibility with old version of Mule.
259 259
260 (defconst coding-spec-type-idx 0) 260 (defconst coding-spec-type-idx 0)
261 (defconst coding-spec-mnemonic-idx 1) 261 (defconst coding-spec-mnemonic-idx 1)
262 (defconst coding-spec-doc-string-idx 2) 262 (defconst coding-spec-doc-string-idx 2)
263 (defconst coding-spec-plist-idx 2)
263 (defconst coding-spec-flags-idx 4) 264 (defconst coding-spec-flags-idx 4)
264 265
265 ;; Coding system may have proerpty `eol-type'. The value of the 266 ;; Coding system may have property `eol-type'. The value of the
266 ;; property `eol-type' is integer 0..2 or a vector of three coding 267 ;; property `eol-type' is integer 0..2 or a vector of three coding
267 ;; systems. The integer value 0, 1, and 2 indicate the format of 268 ;; systems. The integer value 0, 1, and 2 indicate the format of
268 ;; end-of-line LF, CRLF, and CR respectively. The vector value 269 ;; end-of-line LF, CRLF, and CR respectively. The vector value
269 ;; indicates that the format of end-of-line should be detected 270 ;; indicates that the format of end-of-line should be detected
270 ;; automatically. Nth element of the vector is the subsidiary coding 271 ;; automatically. Nth element of the vector is the subsidiary coding
303 ?-)) 304 ?-))
304 305
305 (defun coding-system-doc-string (coding-system) 306 (defun coding-system-doc-string (coding-system)
306 "Return DOC-STRING element in coding-spec of CODING-SYSTEM." 307 "Return DOC-STRING element in coding-spec of CODING-SYSTEM."
307 (coding-system-spec-ref coding-system coding-spec-doc-string-idx)) 308 (coding-system-spec-ref coding-system coding-spec-doc-string-idx))
309
310 (defun coding-system-plist (coding-system)
311 "Return PLIST element in coding-spec of CODING-SYSTEM."
312 (coding-system-spec-ref coding-system coding-spec-plist-idx))
308 313
309 (defun coding-system-flags (coding-system) 314 (defun coding-system-flags (coding-system)
310 "Return FLAGS element in coding-spec of CODING-SYSTEM." 315 "Return FLAGS element in coding-spec of CODING-SYSTEM."
311 (coding-system-spec-ref coding-system coding-spec-flags-idx)) 316 (coding-system-spec-ref coding-system coding-spec-flags-idx))
312 317
467 (aset coding-spec 4 flags) 472 (aset coding-spec 4 flags)
468 (error "Invalid FLAGS argument for TYPE 4 (CCL)"))) 473 (error "Invalid FLAGS argument for TYPE 4 (CCL)")))
469 (t ; i.e. (= type 5) 474 (t ; i.e. (= type 5)
470 (setq coding-category 'coding-category-raw-text))) 475 (setq coding-category 'coding-category-raw-text)))
471 (put coding-system 'coding-system coding-spec) 476 (put coding-system 'coding-system coding-spec)
477 (put coding-system 'coding-system-parent coding-system)
472 (put coding-system 'coding-category coding-category) 478 (put coding-system 'coding-category coding-category)
473 (put coding-category 'coding-systems 479 (put coding-category 'coding-systems
474 (cons coding-system (get coding-category 'coding-systems)))) 480 (cons coding-system (get coding-category 'coding-systems))))
475 481
476 ;; Next, set a value of `eol-type' property. The value is a vector 482 ;; Next, set a value of `eol-type' property. The value is a vector