Mercurial > emacs
comparison lisp/international/ucs-tables.el @ 48767:b5d58a537069
Fix properly.
author | Dave Love <fx@gnu.org> |
---|---|
date | Mon, 09 Dec 2002 18:01:21 +0000 |
parents | 7fbdce538f4a |
children | f4d223f5f6ef |
comparison
equal
deleted
inserted
replaced
48766:c413ffa94be5 | 48767:b5d58a537069 |
---|---|
68 ;; NB, this code depends on the default value of | 68 ;; NB, this code depends on the default value of |
69 ;; `enable-character-translation'. (Making it nil would anyway lead | 69 ;; `enable-character-translation'. (Making it nil would anyway lead |
70 ;; to inconsistent behaviour between CCL-based coding systems which | 70 ;; to inconsistent behaviour between CCL-based coding systems which |
71 ;; use explicit translation tables and the rest.) | 71 ;; use explicit translation tables and the rest.) |
72 | 72 |
73 ;; Command `ucs-insert' is convenient for inserting a given Unicode. | 73 ;; Command `ucs-insert' is convenient for inserting a given unicode. |
74 ;; (See also the `ucs' input method.) | 74 ;; (See also the `ucs' input method.) |
75 | |
76 ;; A replacement CCL program is provided which allows characters in | |
77 ;; the `ucs-mule-to-mule-unicode' table to be displayed with an | |
78 ;; iso-10646-encoded font. E.g. to use a `Unicode' font for Cyrillic: | |
79 ;; | |
80 ;; (set-fontset-font "fontset-startup" | |
81 ;; (cons (make-char 'cyrillic-iso8859-5 160) | |
82 ;; (make-char 'cyrillic-iso8859-5 255)) | |
83 ;; '(nil . "ISO10646-1")) | |
84 | 75 |
85 ;;; Code: | 76 ;;; Code: |
86 | 77 |
87 ;;; Define tables, to be populated later. | 78 ;;; Define tables, to be populated later. |
88 | 79 |
1224 ;; For CCL coding systems other than mule-utf-* (e.g. cyrillic-koi8). | 1215 ;; For CCL coding systems other than mule-utf-* (e.g. cyrillic-koi8). |
1225 (define-translation-table 'ucs-translation-table-for-decode) | 1216 (define-translation-table 'ucs-translation-table-for-decode) |
1226 (setq-default translation-table-for-input nil)) | 1217 (setq-default translation-table-for-input nil)) |
1227 | 1218 |
1228 (when for-encode | 1219 (when for-encode |
1229 ;; Make mule-utf-* disabled for all characters in | 1220 ;; Disable mule-utf-* encoding for all characters in |
1230 ;; ucs-mule-to-mule-unicode but what originally supported and what | 1221 ;; ucs-mule-to-mule-unicode except what was originally supported |
1231 ;; translated bt utf-translation-table-for-decode when | 1222 ;; and what is translated by utf-translation-table-for-decode when |
1232 ;; `utf-fragment-on-decoding' is non-nil. | 1223 ;; `utf-fragment-on-decoding' is non-nil. |
1233 (let ((coding-list '(mule-utf-8 mule-utf-16-be mule-utf-16-le)) | 1224 (let ((coding-list '(mule-utf-8 mule-utf-16-be mule-utf-16-le)) |
1234 (safe (coding-system-get 'mule-utf-8 'safe-chars))) | 1225 (safe (coding-system-get 'mule-utf-8 'safe-chars))) |
1235 (dolist (coding coding-list) | 1226 (dolist (coding coding-list) |
1236 (set-char-table-parent (coding-system-get coding 'safe-chars) nil)) | 1227 (set-char-table-parent (coding-system-get coding 'safe-chars) nil)) |
2442 (aset encode-translator (cdr pair) (car pair)))) | 2433 (aset encode-translator (cdr pair) (car pair)))) |
2443 (if encode-translator | 2434 (if encode-translator |
2444 (optimize-char-table encode-translator)) | 2435 (optimize-char-table encode-translator)) |
2445 (if (charsetp cs) | 2436 (if (charsetp cs) |
2446 (push cs safe-charsets) | 2437 (push cs safe-charsets) |
2447 (setq safe-charsets | 2438 (if (coding-system-p cs) |
2448 (append (delq 'ascii (coding-system-get cs 'safe-charsets)) | 2439 (setq safe-charsets |
2449 safe-charsets))) | 2440 (append (delq 'ascii (coding-system-get cs 'safe-charsets)) |
2441 safe-charsets)))) | |
2450 (cond ((eq cs 'vietnamese-viscii) | 2442 (cond ((eq cs 'vietnamese-viscii) |
2451 (coding-system-put 'vietnamese-viscii | 2443 (coding-system-put 'vietnamese-viscii |
2452 'translation-table-for-input | 2444 'translation-table-for-input |
2453 encode-translator) | 2445 encode-translator) |
2454 (coding-system-put 'vietnamese-viqr | 2446 (coding-system-put 'vietnamese-viqr |