diff options
| author | Kenichi Handa | 1999-02-18 13:11:24 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1999-02-18 13:11:24 +0000 |
| commit | 80a7463d835a8a5daab81ae88fd84d25ee992534 (patch) | |
| tree | ca6e59037634e1177d04150d1a5a705d72a5dd2f | |
| parent | 9da8350f2efab0bc2f1d631a697705ceda652b0f (diff) | |
| download | emacs-80a7463d835a8a5daab81ae88fd84d25ee992534.tar.gz emacs-80a7463d835a8a5daab81ae88fd84d25ee992534.zip | |
(coding-system-list): Moved here from
mule-util.el to avoid autoloading mule-util by the call of
select-safe-coding-system.
| -rw-r--r-- | lisp/international/mule.el | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lisp/international/mule.el b/lisp/international/mule.el index b8f91b9ed90..0c5c78c49e0 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el | |||
| @@ -481,6 +481,25 @@ coding system whose eol-type is N." | |||
| 481 | (setq len (/ len 2)))) | 481 | (setq len (/ len 2)))) |
| 482 | (setcdr tem (cons coding-system (cdr tem)))))) | 482 | (setcdr tem (cons coding-system (cdr tem)))))) |
| 483 | 483 | ||
| 484 | (defun coding-system-list (&optional base-only) | ||
| 485 | "Return a list of all existing coding systems. | ||
| 486 | If optional arg BASE-ONLY is non-nil, only base coding systems are listed." | ||
| 487 | (let* ((codings (copy-sequence coding-system-list)) | ||
| 488 | (tail (cons nil codings))) | ||
| 489 | ;; Remove subsidiary coding systems (eol variants) and alias | ||
| 490 | ;; coding systems (if necessary). | ||
| 491 | (while (cdr tail) | ||
| 492 | (let* ((coding (car (cdr tail))) | ||
| 493 | (aliases (coding-system-get coding 'alias-coding-systems))) | ||
| 494 | (if (or | ||
| 495 | ;; CODING is an eol variant if not in ALIASES. | ||
| 496 | (not (memq coding aliases)) | ||
| 497 | ;; CODING is an alias if it is not car of ALIASES. | ||
| 498 | (and base-only (not (eq coding (car aliases))))) | ||
| 499 | (setcdr tail (cdr (cdr tail))) | ||
| 500 | (setq tail (cdr tail))))) | ||
| 501 | codings)) | ||
| 502 | |||
| 484 | ;; Make subsidiary coding systems (eol-type variants) of CODING-SYSTEM. | 503 | ;; Make subsidiary coding systems (eol-type variants) of CODING-SYSTEM. |
| 485 | (defun make-subsidiary-coding-system (coding-system) | 504 | (defun make-subsidiary-coding-system (coding-system) |
| 486 | (let ((coding-spec (coding-system-spec coding-system)) | 505 | (let ((coding-spec (coding-system-spec coding-system)) |