Mercurial > emacs
comparison lisp/international/quail.el @ 19519:1c0ecc266e38
(quail-terminate-translation): Doc-string
fixed. Set quail-prefix-arg to nil after handling it.
(quail-self-insert-command): Set overriding-terminal-local-map to
nil when thown for `quail-tag' by value nil.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Mon, 25 Aug 1997 01:06:41 +0000 |
parents | e6134c179b4c |
children | 3b700b203cfd |
comparison
equal
deleted
inserted
replaced
19518:0f690a5476fe | 19519:1c0ecc266e38 |
---|---|
945 (if (overlay-start quail-overlay) | 945 (if (overlay-start quail-overlay) |
946 (delete-region (overlay-start quail-overlay) | 946 (delete-region (overlay-start quail-overlay) |
947 (overlay-end quail-overlay)))) | 947 (overlay-end quail-overlay)))) |
948 | 948 |
949 (defun quail-terminate-translation () | 949 (defun quail-terminate-translation () |
950 "Terminate the translation of the current key. | 950 "Terminate the translation of the current key." |
951 Optional arg SUPPRESS-INSERT-CHUNK-HOOK if non-nil means don't run hooks | |
952 in `input-method-after-insert-chunk-hook' (which see)." | |
953 (let ((start (overlay-start quail-overlay))) | 951 (let ((start (overlay-start quail-overlay))) |
954 (if (and start | 952 (if (and start |
955 (< start (overlay-end quail-overlay))) | 953 (< start (overlay-end quail-overlay))) |
956 ;; Here we simulate self-insert-command. | 954 ;; Here we simulate self-insert-command. |
957 (let ((seq (string-to-sequence | 955 (let ((seq (string-to-sequence |
961 last-command-char) | 959 last-command-char) |
962 (goto-char start) | 960 (goto-char start) |
963 (quail-delete-region) | 961 (quail-delete-region) |
964 (setq last-command-char (car seq)) | 962 (setq last-command-char (car seq)) |
965 (self-insert-command (or quail-prefix-arg 1)) | 963 (self-insert-command (or quail-prefix-arg 1)) |
964 (setq quail-prefix-arg nil) | |
966 (setq seq (cdr seq)) | 965 (setq seq (cdr seq)) |
967 (while seq | 966 (while seq |
968 (setq last-command-char (car seq)) | 967 (setq last-command-char (car seq)) |
969 (self-insert-command 1) | 968 (self-insert-command 1) |
970 (setq seq (cdr seq)))))) | 969 (setq seq (cdr seq)))))) |
974 (set-buffer quail-guidance-buf) | 973 (set-buffer quail-guidance-buf) |
975 (erase-buffer))) | 974 (erase-buffer))) |
976 (setq overriding-terminal-local-map | 975 (setq overriding-terminal-local-map |
977 (quail-conversion-keymap)) | 976 (quail-conversion-keymap)) |
978 ;; Run this hook only when the current input method doesn't require | 977 ;; Run this hook only when the current input method doesn't require |
979 ;; conversion. When it requires, the conversoin function should run | 978 ;; conversion. When conversion is required, the conversion function |
980 ;; this hook at a proper timing. | 979 ;; should run this hook at a proper timing. |
981 (unless (quail-conversion-keymap) | 980 (unless (quail-conversion-keymap) |
982 (run-hooks 'input-method-after-insert-chunk-hook))) | 981 (run-hooks 'input-method-after-insert-chunk-hook))) |
983 | 982 |
984 (defun quail-select-current () | 983 (defun quail-select-current () |
985 "Select the current text shown in Quail translation region." | 984 "Select the current text shown in Quail translation region." |
1016 (defun quail-self-insert-command () | 1015 (defun quail-self-insert-command () |
1017 "Add the typed character to the key for translation." | 1016 "Add the typed character to the key for translation." |
1018 (interactive "*") | 1017 (interactive "*") |
1019 (setq quail-current-key | 1018 (setq quail-current-key |
1020 (concat quail-current-key (char-to-string last-command-event))) | 1019 (concat quail-current-key (char-to-string last-command-event))) |
1021 (catch 'quail-tag | 1020 (unless (catch 'quail-tag |
1022 (quail-update-translation (quail-translate-key)))) | 1021 (quail-update-translation (quail-translate-key)) |
1022 t) | |
1023 ;; If someone throws for `quail-tag' by value nil, we exit from | |
1024 ;; translation mode. | |
1025 (setq overriding-terminal-local-map nil))) | |
1023 | 1026 |
1024 ;; Return the actual definition part of Quail map MAP. | 1027 ;; Return the actual definition part of Quail map MAP. |
1025 (defun quail-map-definition (map) | 1028 (defun quail-map-definition (map) |
1026 (let ((def (car map))) | 1029 (let ((def (car map))) |
1027 (if (and (consp def) (not (vectorp (cdr def)))) | 1030 (if (and (consp def) (not (vectorp (cdr def)))) |