diff options
| author | Kenichi Handa | 2005-05-27 11:20:16 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2005-05-27 11:20:16 +0000 |
| commit | 848613f8691dfab1b9e4de0b0a7a3254d9e00fb4 (patch) | |
| tree | 4c4cfccee025f09ca718f0905ede9b8f9b236dcd | |
| parent | 5e2ad10b99541b8c1d66bb9b6ceca4b69dfa6131 (diff) | |
| download | emacs-848613f8691dfab1b9e4de0b0a7a3254d9e00fb4.tar.gz emacs-848613f8691dfab1b9e4de0b0a7a3254d9e00fb4.zip | |
Don't register a coding system into
non-iso-charset-alist more than once.
(cp-make-coding-system): Likewise.
| -rw-r--r-- | lisp/international/code-pages.el | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/lisp/international/code-pages.el b/lisp/international/code-pages.el index 73c953a2fe4..c70388ba4c9 100644 --- a/lisp/international/code-pages.el +++ b/lisp/international/code-pages.el | |||
| @@ -193,15 +193,18 @@ Return an updated `non-iso-charset-alist'." | |||
| 193 | ;; a separate table that only translates the coding | 193 | ;; a separate table that only translates the coding |
| 194 | ;; system's safe-chars. | 194 | ;; system's safe-chars. |
| 195 | (cons 'translation-table-for-input 'ucs-mule-to-mule-unicode))) | 195 | (cons 'translation-table-for-input 'ucs-mule-to-mule-unicode))) |
| 196 | (push (list ',name | 196 | (let ((slot (assq ',name non-iso-charset-alist)) |
| 197 | nil ; charset list | 197 | (elt (list nil ; charset list |
| 198 | ',decoder | 198 | ',decoder |
| 199 | (let (l) ; code range | 199 | (let (l) ; code range |
| 200 | (dolist (elt (reverse codes)) | 200 | (dolist (elt (reverse codes)) |
| 201 | (push (cdr elt) l) | 201 | (push (cdr elt) l) |
| 202 | (push (car elt) l)) | 202 | (push (car elt) l)) |
| 203 | (list l))) | 203 | (list l))))) |
| 204 | non-iso-charset-alist)))) | 204 | (if (not slot) |
| 205 | (push (cons ',name elt) non-iso-charset-alist) | ||
| 206 | (setcdr slot elt) | ||
| 207 | non-iso-charset-alist))))) | ||
| 205 | 208 | ||
| 206 | (eval-when-compile (defvar non-iso-charset-alist)) | 209 | (eval-when-compile (defvar non-iso-charset-alist)) |
| 207 | 210 | ||
| @@ -4502,11 +4505,14 @@ Return an updated `non-iso-charset-alist'." | |||
| 4502 | ;; Define cp125* as aliases for all windows-125*, so on Windows | 4505 | ;; Define cp125* as aliases for all windows-125*, so on Windows |
| 4503 | ;; we can just concat "cp" to the ANSI codepage we get from the system | 4506 | ;; we can just concat "cp" to the ANSI codepage we get from the system |
| 4504 | ;; and not have to worry about whether it should be "cp" or "windows-". | 4507 | ;; and not have to worry about whether it should be "cp" or "windows-". |
| 4505 | (if (coding-system-p w) | 4508 | (when (coding-system-p w) |
| 4506 | (define-coding-system-alias c w)) | 4509 | (define-coding-system-alias c w) |
| 4507 | ;; Compatibility with codepage.el, though cp... are not the | 4510 | ;; Compatibility with codepage.el, though cp... are not the |
| 4508 | ;; canonical names. | 4511 | ;; canonical names. |
| 4509 | (push (assoc w non-iso-charset-alist) non-iso-charset-alist))) | 4512 | (if (not (assq c non-iso-charset-alist)) |
| 4513 | (let ((slot (assq w non-iso-charset-alist))) | ||
| 4514 | (if slot | ||
| 4515 | (push (cons c (cdr slot)) non-iso-charset-alist))))))) | ||
| 4510 | 4516 | ||
| 4511 | (provide 'code-pages) | 4517 | (provide 'code-pages) |
| 4512 | 4518 | ||