diff options
| author | Dave Love | 2002-11-09 12:53:43 +0000 |
|---|---|---|
| committer | Dave Love | 2002-11-09 12:53:43 +0000 |
| commit | 875d910694ea94c05a726d5db5ad2f35d7754185 (patch) | |
| tree | 98c4c503fd56dffba7449f65e555e8c6a4c52287 | |
| parent | eb9fc9e65001beaadcb4de62e6d1894574586627 (diff) | |
| download | emacs-875d910694ea94c05a726d5db5ad2f35d7754185.tar.gz emacs-875d910694ea94c05a726d5db5ad2f35d7754185.zip | |
Revert to using
translation-table-for-input instead of keyboard-translate-table.
| -rw-r--r-- | lisp/international/ucs-tables.el | 61 |
1 files changed, 27 insertions, 34 deletions
diff --git a/lisp/international/ucs-tables.el b/lisp/international/ucs-tables.el index ca21f6049ff..99574ad315c 100644 --- a/lisp/international/ucs-tables.el +++ b/lisp/international/ucs-tables.el | |||
| @@ -56,12 +56,12 @@ | |||
| 56 | ;; `utf-fragment-on-decoding' which may specify decoding Greek and | 56 | ;; `utf-fragment-on-decoding' which may specify decoding Greek and |
| 57 | ;; Cyrillic into 8859 charsets. | 57 | ;; Cyrillic into 8859 charsets. |
| 58 | 58 | ||
| 59 | ;; Unification also arranges for the `keyboard-translate-table' | 59 | ;; Unification also arranges for `translation-table-for-input' to be |
| 60 | ;; variable to be set either globally or locally. This is used to | 60 | ;; set either globally or locally. This is used to translate input |
| 61 | ;; translate input characters appropriately for the buffer's coding | 61 | ;; characters appropriately for the buffer's coding system (if |
| 62 | ;; system (if possible). Unification on decoding sets it globally to | 62 | ;; possible). Unification on decoding sets it globally to translate |
| 63 | ;; translate to Unicode. Unification on encoding uses hooks to set it | 63 | ;; to Unicode. Unification on encoding uses hooks to set it up |
| 64 | ;; up locally to buffers. Thus in the latter case, typing `"a' into a | 64 | ;; locally to buffers. Thus in the latter case, typing `"a' into a |
| 65 | ;; Latin-1 buffer using the `latin-2-prefix' method translates the | 65 | ;; Latin-1 buffer using the `latin-2-prefix' method translates the |
| 66 | ;; generated latin-iso8859-2 `,Bd(B' into latin-iso8859-1 `,Ad(B'. | 66 | ;; generated latin-iso8859-2 `,Bd(B' into latin-iso8859-1 `,Ad(B'. |
| 67 | 67 | ||
| @@ -155,9 +155,9 @@ Translates from the iso8859 charsets and `mule-unicode-0100-24ff'.") | |||
| 155 | "Used as `translation-table-for-encode' for iso-8859-15. | 155 | "Used as `translation-table-for-encode' for iso-8859-15. |
| 156 | Translates from the iso8859 charsets and `mule-unicode-0100-24ff'.") | 156 | Translates from the iso8859 charsets and `mule-unicode-0100-24ff'.") |
| 157 | 157 | ||
| 158 | (setq-default keyboard-translate-table (make-translation-table)) | 158 | (setq translation-table-for-input (make-translation-table)) |
| 159 | ;; It will normally be set locally, before the major mode is invoked. | 159 | ;; It will normally be set locally, before the major mode is invoked. |
| 160 | (put 'keyboard-translate-table 'permanent-local t) | 160 | (put 'translation-table-for-input 'permanent-local t) |
| 161 | 161 | ||
| 162 | (define-translation-table 'ucs-translation-table-for-decode) | 162 | (define-translation-table 'ucs-translation-table-for-decode) |
| 163 | 163 | ||
| @@ -1179,11 +1179,9 @@ everything on input operations." | |||
| 1179 | ;; For CCL coding systems other than mule-utf-* | 1179 | ;; For CCL coding systems other than mule-utf-* |
| 1180 | (define-translation-table 'ucs-translation-table-for-decode | 1180 | (define-translation-table 'ucs-translation-table-for-decode |
| 1181 | ucs-mule-8859-to-mule-unicode) | 1181 | ucs-mule-8859-to-mule-unicode) |
| 1182 | ;; Translate keyboard input globally. | 1182 | |
| 1183 | (let ((table (default-value 'keyboard-translate-table))) | 1183 | ;; Translate Quail input globally. |
| 1184 | (map-char-table (lambda (k v) | 1184 | (setq-default translation-table-for-input ucs-mule-to-mule-unicode) |
| 1185 | (aset table k v)) | ||
| 1186 | ucs-mule-to-mule-unicode)) | ||
| 1187 | ;; In case these are set up, but we should use the global | 1185 | ;; In case these are set up, but we should use the global |
| 1188 | ;; translation-table. | 1186 | ;; translation-table. |
| 1189 | (remove-hook 'set-buffer-major-mode-hook 'ucs-set-table-for-input) | 1187 | (remove-hook 'set-buffer-major-mode-hook 'ucs-set-table-for-input) |
| @@ -1230,10 +1228,7 @@ unification on input operations." | |||
| 1230 | (set-char-table-parent standard-translation-table-for-decode nil) | 1228 | (set-char-table-parent standard-translation-table-for-decode nil) |
| 1231 | ;; For CCL coding systems other than mule-utf-* (e.g. cyrillic-koi8). | 1229 | ;; For CCL coding systems other than mule-utf-* (e.g. cyrillic-koi8). |
| 1232 | (define-translation-table 'ucs-translation-table-for-decode) | 1230 | (define-translation-table 'ucs-translation-table-for-decode) |
| 1233 | (let ((table (default-value 'keyboard-translate-table))) | 1231 | (setq-default translation-table-for-input nil)) |
| 1234 | (map-char-table (lambda (k v) | ||
| 1235 | (aset table k nil)) | ||
| 1236 | ucs-mule-to-mule-unicode))) | ||
| 1237 | 1232 | ||
| 1238 | (when for-encode | 1233 | (when for-encode |
| 1239 | ;; Make mule-utf-* disabled for all characters in | 1234 | ;; Make mule-utf-* disabled for all characters in |
| @@ -2452,13 +2447,13 @@ Interactively, prompts for a hex string giving the code." | |||
| 2452 | safe-charsets))) | 2447 | safe-charsets))) |
| 2453 | (cond ((eq cs 'vietnamese-viscii) | 2448 | (cond ((eq cs 'vietnamese-viscii) |
| 2454 | (coding-system-put 'vietnamese-viscii | 2449 | (coding-system-put 'vietnamese-viscii |
| 2455 | 'keyboard-translate-table | 2450 | 'translation-table-for-input |
| 2456 | encode-translator) | 2451 | encode-translator) |
| 2457 | (coding-system-put 'vietnamese-viqr | 2452 | (coding-system-put 'vietnamese-viqr |
| 2458 | 'keyboard-translate-table | 2453 | 'translation-table-for-input |
| 2459 | encode-translator)) | 2454 | encode-translator)) |
| 2460 | ((memq cs '(lao thai-tis620 tibetan-iso-8bit)) | 2455 | ((memq cs '(lao thai-tis620 tibetan-iso-8bit)) |
| 2461 | (coding-system-put cs 'keyboard-translate-table cs))))) | 2456 | (coding-system-put cs 'translation-table-for-input cs))))) |
| 2462 | (dolist (c safe-charsets) | 2457 | (dolist (c safe-charsets) |
| 2463 | (aset table (make-char c) t)))) | 2458 | (aset table (make-char c) t)))) |
| 2464 | 2459 | ||
| @@ -2483,10 +2478,11 @@ directly to a byte value 233. By default, in contrast, you would be | |||
| 2483 | prompted for a general coding system to use for saving the file, which | 2478 | prompted for a general coding system to use for saving the file, which |
| 2484 | can cope with separate Latin-1 and Latin-9 representations of e-acute. | 2479 | can cope with separate Latin-1 and Latin-9 representations of e-acute. |
| 2485 | 2480 | ||
| 2486 | Also sets hooks that arrange `keyboard-translate-table' to be set up | 2481 | Also sets hooks that arrange `translation-table-for-input' to be set |
| 2487 | locally. This will often allow input to conform with what the | 2482 | up locally. This will often allow input generated by Quail input |
| 2488 | buffer's file coding system can encode. Thus you could use a Latin-2 | 2483 | methods to conform with what the buffer's file coding system can |
| 2489 | input method to search for e-acute in a Latin-1 buffer. | 2484 | encode. Thus you could use a Latin-2 input method to search for |
| 2485 | e-acute in a Latin-1 buffer. | ||
| 2490 | 2486 | ||
| 2491 | See also command `unify-8859-on-decoding-mode'." | 2487 | See also command `unify-8859-on-decoding-mode'." |
| 2492 | :group 'mule | 2488 | :group 'mule |
| @@ -2504,7 +2500,8 @@ On decoding, i.e. input operations, non-ASCII characters from the | |||
| 2504 | built-in ISO 8859 charsets are unified by mapping them into the | 2500 | built-in ISO 8859 charsets are unified by mapping them into the |
| 2505 | `iso-latin-1' and `mule-unicode-0100-24ff' charsets. | 2501 | `iso-latin-1' and `mule-unicode-0100-24ff' charsets. |
| 2506 | 2502 | ||
| 2507 | Also sets `keyboard-translate-table' globally. | 2503 | Also sets `translation-table-for-input' globally, so that keyboard input |
| 2504 | produces unified characters. | ||
| 2508 | 2505 | ||
| 2509 | See also command `unify-8859-on-encoding-mode' and the user option | 2506 | See also command `unify-8859-on-encoding-mode' and the user option |
| 2510 | `utf-fragment-on-decoding'." | 2507 | `utf-fragment-on-decoding'." |
| @@ -2524,9 +2521,9 @@ See also command `unify-8859-on-encoding-mode' and the user option | |||
| 2524 | ;; Arrange to set up the translation-table for keyboard input. This | 2521 | ;; Arrange to set up the translation-table for keyboard input. This |
| 2525 | ;; probably isn't foolproof. | 2522 | ;; probably isn't foolproof. |
| 2526 | (defun ucs-set-table-for-input () | 2523 | (defun ucs-set-table-for-input () |
| 2527 | "Set up an appropriate `keyboard-translate-table' for current buffer." | 2524 | "Set up an appropriate `translation-table-for-input' for current buffer." |
| 2528 | (when (and unify-8859-on-encoding-mode | 2525 | (when (and unify-8859-on-encoding-mode |
| 2529 | (char-table-p keyboard-translate-table)) | 2526 | (char-table-p translation-table-for-input)) |
| 2530 | (let ((cs (and buffer-file-coding-system | 2527 | (let ((cs (and buffer-file-coding-system |
| 2531 | (coding-system-base buffer-file-coding-system))) | 2528 | (coding-system-base buffer-file-coding-system))) |
| 2532 | table) | 2529 | table) |
| @@ -2537,14 +2534,10 @@ See also command `unify-8859-on-encoding-mode' and the user option | |||
| 2537 | (when cs | 2534 | (when cs |
| 2538 | (setq table (coding-system-get cs 'translation-table-for-encode)) | 2535 | (setq table (coding-system-get cs 'translation-table-for-encode)) |
| 2539 | (unless (char-table-p table) | 2536 | (unless (char-table-p table) |
| 2540 | (setq table (coding-system-get cs 'keyboard-translate-table))) | 2537 | (setq table (coding-system-get cs 'translation-table-for-input))) |
| 2541 | (when (char-table-p table) | 2538 | (when (char-table-p table) |
| 2542 | (set (make-variable-buffer-local 'keyboard-translate-table) | 2539 | (set (make-variable-buffer-local 'translation-table-for-input) |
| 2543 | 2540 | table)))))) | |
| 2544 | (let ((new (copy-sequence table))) | ||
| 2545 | (set-char-table-parent | ||
| 2546 | new (default-value 'keyboard-translate-table)) | ||
| 2547 | new))))))) | ||
| 2548 | 2541 | ||
| 2549 | ;; The minibuffer needs to acquire a `buffer-file-coding-system' for | 2542 | ;; The minibuffer needs to acquire a `buffer-file-coding-system' for |
| 2550 | ;; the above to work in it. | 2543 | ;; the above to work in it. |