diff options
| -rw-r--r-- | lisp/international/mule.el | 48 |
1 files changed, 33 insertions, 15 deletions
diff --git a/lisp/international/mule.el b/lisp/international/mule.el index c2cba9db003..7e40f1ad056 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el | |||
| @@ -195,6 +195,10 @@ PLIST (property list) may contain any type of information a user | |||
| 195 | `(make-char-internal ,(charset-id (nth 1 charset)) ,c1 ,c2) | 195 | `(make-char-internal ,(charset-id (nth 1 charset)) ,c1 ,c2) |
| 196 | `(make-char-internal (charset-id ,charset) ,c1 ,c2))) | 196 | `(make-char-internal (charset-id ,charset) ,c1 ,c2))) |
| 197 | 197 | ||
| 198 | (defmacro charset-list () | ||
| 199 | "Return list of charsets ever defined." | ||
| 200 | charset-list) | ||
| 201 | |||
| 198 | ;; Coding-system staffs | 202 | ;; Coding-system staffs |
| 199 | 203 | ||
| 200 | ;; Coding-system object is a symbol that has the property | 204 | ;; Coding-system object is a symbol that has the property |
| @@ -237,27 +241,32 @@ PLIST (property list) may contain any type of information a user | |||
| 237 | 241 | ||
| 238 | ;; Return type of CODING-SYSTEM. | 242 | ;; Return type of CODING-SYSTEM. |
| 239 | (defun coding-system-type (coding-system) | 243 | (defun coding-system-type (coding-system) |
| 244 | (check-coding-system coding-system) | ||
| 240 | (let ((vec (coding-system-vector coding-system))) | 245 | (let ((vec (coding-system-vector coding-system))) |
| 241 | (if vec (coding-vector-type vec)))) | 246 | (if vec (coding-vector-type vec)))) |
| 242 | 247 | ||
| 243 | ;; Return mnemonic character of CODING-SYSTEM. | 248 | ;; Return mnemonic character of CODING-SYSTEM. |
| 244 | (defun coding-system-mnemonic (coding-system) | 249 | (defun coding-system-mnemonic (coding-system) |
| 250 | (check-coding-system coding-system) | ||
| 245 | (let ((vec (coding-system-vector coding-system))) | 251 | (let ((vec (coding-system-vector coding-system))) |
| 246 | (if vec (coding-vector-mnemonic vec) | 252 | (if vec (coding-vector-mnemonic vec) |
| 247 | ?-))) | 253 | ?-))) |
| 248 | 254 | ||
| 249 | ;; Return docstring of CODING-SYSTEM. | 255 | ;; Return docstring of CODING-SYSTEM. |
| 250 | (defun coding-system-docstring (coding-system) | 256 | (defun coding-system-docstring (coding-system) |
| 257 | (check-coding-system coding-system) | ||
| 251 | (let ((vec (coding-system-vector coding-system))) | 258 | (let ((vec (coding-system-vector coding-system))) |
| 252 | (if vec (coding-vector-docstring vec)))) | 259 | (if vec (coding-vector-docstring vec)))) |
| 253 | 260 | ||
| 254 | ;; Return flags of CODING-SYSTEM. | 261 | ;; Return flags of CODING-SYSTEM. |
| 255 | (defun coding-system-flags (coding-system) | 262 | (defun coding-system-flags (coding-system) |
| 263 | (check-coding-system coding-system) | ||
| 256 | (let ((vec (coding-system-vector coding-system))) | 264 | (let ((vec (coding-system-vector coding-system))) |
| 257 | (if vec (coding-vector-flags vec)))) | 265 | (if vec (coding-vector-flags vec)))) |
| 258 | 266 | ||
| 259 | ;; Return eol-type of CODING-SYSTEM. | 267 | ;; Return eol-type of CODING-SYSTEM. |
| 260 | (defun coding-system-eoltype (coding-system) | 268 | (defun coding-system-eoltype (coding-system) |
| 269 | (check-coding-system coding-system) | ||
| 261 | (and coding-system | 270 | (and coding-system |
| 262 | (or (get coding-system 'eol-type) | 271 | (or (get coding-system 'eol-type) |
| 263 | (coding-system-eoltype (get coding-system 'coding-system))))) | 272 | (coding-system-eoltype (get coding-system 'coding-system))))) |
| @@ -319,6 +328,10 @@ FLAGS specifies more precise information of each TYPE. | |||
| 319 | USE-ROMAN non-nil means designate JIS0201-1976-Roman instead of ASCII. | 328 | USE-ROMAN non-nil means designate JIS0201-1976-Roman instead of ASCII. |
| 320 | USE-OLDJIS non-nil means designate JIS0208-1976 instead of JIS0208-1983. | 329 | USE-OLDJIS non-nil means designate JIS0208-1976 instead of JIS0208-1983. |
| 321 | NO-ISO6429 non-nil means not use ISO6429's direction specification. | 330 | NO-ISO6429 non-nil means not use ISO6429's direction specification. |
| 331 | INIT-BOL non-nil means any designation state is assumed to be reset | ||
| 332 | to initial at each beginning of line on output. | ||
| 333 | DESIGNATION-BOL non-nil means designation sequences should be placed | ||
| 334 | at beginning of line on output. | ||
| 322 | If TYPE is 4 (private), FLAGS should be a cons of CCL programs, | 335 | If TYPE is 4 (private), FLAGS should be a cons of CCL programs, |
| 323 | for encoding and decoding. See the documentation of CCL for more detail." | 336 | for encoding and decoding. See the documentation of CCL for more detail." |
| 324 | 337 | ||
| @@ -335,14 +348,14 @@ FLAGS specifies more precise information of each TYPE. | |||
| 335 | (vec (make-vector 32 nil))) | 348 | (vec (make-vector 32 nil))) |
| 336 | (while (< i 4) | 349 | (while (< i 4) |
| 337 | (let ((charset (car flags))) | 350 | (let ((charset (car flags))) |
| 338 | (if (and charset (not (eq charset t))) | 351 | (or (not charset) (eq charset t) (charsetp charset) |
| 339 | (if (symbolp charset) | 352 | (if (not (listp charset)) |
| 340 | (setq charset (charset-id charset)) | 353 | (error "Invalid charset: %s" charset) |
| 341 | (let (elt l) | 354 | (let (elt l) |
| 342 | (while charset | 355 | (while charset |
| 343 | (setq elt (car charset)) | 356 | (setq elt (car charset)) |
| 344 | (if (and elt (not (eq elt t))) | 357 | (or (not elt) (eq elt t) (charsetp elt) |
| 345 | (setq elt (charset-id elt))) | 358 | (error "Invalid charset: %s" elt)) |
| 346 | (setq l (cons elt l)) | 359 | (setq l (cons elt l)) |
| 347 | (setq charset (cdr charset))) | 360 | (setq charset (cdr charset))) |
| 348 | (setq charset (nreverse l))))) | 361 | (setq charset (nreverse l))))) |
| @@ -378,18 +391,17 @@ FLAGS specifies more precise information of each TYPE. | |||
| 378 | (defun define-coding-system-alias (symbol new-symbol) | 391 | (defun define-coding-system-alias (symbol new-symbol) |
| 379 | "Define NEW-SYMBOL as the same coding system as SYMBOL." | 392 | "Define NEW-SYMBOL as the same coding system as SYMBOL." |
| 380 | (check-coding-system symbol) | 393 | (check-coding-system symbol) |
| 381 | (put new-symbol 'coding-system (get symbol 'coding-system)) | 394 | (put new-symbol 'coding-system symbol) |
| 382 | (let ((eol-type (get symbol 'eol-type))) | 395 | (let ((eol-type (coding-system-eoltype symbol))) |
| 383 | (if (vectorp eol-type) | 396 | (if (vectorp eol-type) |
| 384 | (let* ((name (symbol-name new-symbol)) | 397 | (let* ((name (symbol-name new-symbol)) |
| 385 | (new (vector (intern (concat name "-unix")) | 398 | (new-eol-type (vector (intern (concat name "-unix")) |
| 386 | (intern (concat name "-dos")) | 399 | (intern (concat name "-dos")) |
| 387 | (intern (concat name "-mac")))) | 400 | (intern (concat name "-mac"))))) |
| 388 | (i 0)) | 401 | (define-coding-system-alias (aref eol-type 0) (aref new-eol-type 0)) |
| 389 | (while (< i 3) | 402 | (define-coding-system-alias (aref eol-type 1) (aref new-eol-type 1)) |
| 390 | (define-coding-system-alias (aref eol-type i) (aref new i)) | 403 | (define-coding-system-alias (aref eol-type 2) (aref new-eol-type 2)) |
| 391 | (setq i (1+ i))) | 404 | (setq eol-type new-eol-type))) |
| 392 | (setq eol-type new))) | ||
| 393 | (put new-symbol 'eol-type eol-type))) | 405 | (put new-symbol 'eol-type eol-type))) |
| 394 | 406 | ||
| 395 | (defvar buffer-file-coding-system nil | 407 | (defvar buffer-file-coding-system nil |
| @@ -525,6 +537,12 @@ buffer-file-coding-system." | |||
| 525 | (aref (coding-system-eoltype new-coding) new-eol))) | 537 | (aref (coding-system-eoltype new-coding) new-eol))) |
| 526 | new-coding)))) | 538 | new-coding)))) |
| 527 | 539 | ||
| 540 | ;;; Initialize some variables. | ||
| 541 | |||
| 542 | (put 'use-default-ascent 'char-table-extra-slots 0) | ||
| 543 | (setq use-default-ascent (make-char-table 'use-default-ascent)) | ||
| 544 | |||
| 545 | ;;; | ||
| 528 | (provide 'mule) | 546 | (provide 'mule) |
| 529 | 547 | ||
| 530 | ;;; mule.el ends here | 548 | ;;; mule.el ends here |