Mercurial > emacs
comparison lisp/international/quail.el @ 19327:70e5d1211d98
(quail-start-translation): Use an explicit loop, not recursive edit.
(quail-suppress-conversion): Doc fix.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 13 Aug 1997 00:26:42 +0000 |
parents | 74ec766c0ada |
children | 763bc03e7797 |
comparison
equal
deleted
inserted
replaced
19326:14681d10a973 | 19327:70e5d1211d98 |
---|---|
896 ;; Whole text in conversion area was deleted. Let's exit from | 896 ;; Whole text in conversion area was deleted. Let's exit from |
897 ;; the recursive edit. | 897 ;; the recursive edit. |
898 (throw 'exit nil))) | 898 (throw 'exit nil))) |
899 | 899 |
900 (defvar quail-suppress-conversion nil | 900 (defvar quail-suppress-conversion nil |
901 "If non-nil, suppress converting facility of the current Quail package.") | 901 "If non-nil, suppress conversion facility of the current Quail package. |
902 We distinguish between \"translation\" and \"conversion\" aspects | |
903 of an input method. Translation is the first step, done by Quail itself; | |
904 conversion is the second step which changes the translated text into | |
905 bettertext. For instance, the Quail package for Japanese (`quail-jp') | |
906 translates Roman text (transliteration of Japanese in Latin alphabets) | |
907 to Hiragana text, and then converts the Hiragana into Kanji-and-Kana | |
908 mixed text or Katakana text. | |
909 | |
910 If this variable is non-nil, translation still occurs, but not conversion.") | |
902 | 911 |
903 ;; If set to non-nil, exit conversion mode before starting new translation. | 912 ;; If set to non-nil, exit conversion mode before starting new translation. |
904 (defvar quail-exit-conversion-mode nil) | 913 (defvar quail-exit-conversion-mode nil) |
905 | 914 |
906 (defvar quail-prefix-arg nil) | 915 (defvar quail-prefix-arg nil) |
919 (quail-setup-overlays) | 928 (quail-setup-overlays) |
920 (if (catch 'quail-tag | 929 (if (catch 'quail-tag |
921 (if (and (not quail-suppress-conversion) | 930 (if (and (not quail-suppress-conversion) |
922 (quail-conversion-keymap)) | 931 (quail-conversion-keymap)) |
923 ;; We must start translation in conversion mode. | 932 ;; We must start translation in conversion mode. |
924 (let ((overriding-local-map (quail-conversion-keymap))) | 933 (let ((overriding-terminal-local-map (quail-conversion-keymap))) |
925 (setq quail-exit-conversion-mode nil) | 934 (setq quail-exit-conversion-mode nil) |
926 (recursive-edit) | 935 (catch 'exit |
936 (while t | |
937 (let* ((key (read-key-sequence nil)) | |
938 (definition (lookup-key overriding-terminal-local-map key t))) | |
939 (setq last-command-event (aref key 0)) | |
940 (setq prefix-arg nil) | |
941 (if definition (call-interactively definition))))) | |
927 (if (and auto-fill-function | 942 (if (and auto-fill-function |
928 (> (current-column) (current-fill-column))) | 943 (> (current-column) (current-fill-column))) |
929 (run-hooks 'auto-fill-function))) | 944 (run-hooks 'auto-fill-function))) |
930 (let ((overriding-local-map (quail-translation-keymap))) | 945 (let ((overriding-terminal-local-map (quail-translation-keymap))) |
931 (setq quail-current-key "") | 946 (setq quail-current-key "") |
932 (recursive-edit))) | 947 (catch 'exit |
948 (while t | |
949 (let* ((key (read-key-sequence nil)) | |
950 (definition (lookup-key overriding-terminal-local-map key t))) | |
951 (setq last-command-event (aref key 0)) | |
952 (setq prefix-arg nil) | |
953 (if definition (call-interactively definition))))))) | |
933 (if (prog1 (< (overlay-start quail-conv-overlay) | 954 (if (prog1 (< (overlay-start quail-conv-overlay) |
934 (overlay-end quail-conv-overlay)) | 955 (overlay-end quail-conv-overlay)) |
935 (delete-overlay quail-conv-overlay)) | 956 (delete-overlay quail-conv-overlay)) |
936 (run-hooks 'input-method-after-insert-chunk-hook)) | 957 (run-hooks 'input-method-after-insert-chunk-hook)) |
937 nil) | 958 nil) |
938 ;; Someone has thrown a tag with value t, which means | 959 ;; Someone has thrown a tag with value t, which means |
939 ;; we should turn Quail mode off. | 960 ;; we should turn Quail mode off. |
940 (quail-mode -1))) | 961 (quail-mode -1)) |
962 (message "")) | |
941 ;; Since the typed character doesn't start any translation, handle | 963 ;; Since the typed character doesn't start any translation, handle |
942 ;; it out of Quail mode. We come back to Quail mode later because | 964 ;; it out of Quail mode. We come back to Quail mode later because |
943 ;; function `quail-toggle-mode-temporarily' is in | 965 ;; function `quail-toggle-mode-temporarily' is in |
944 ;; `post-command-hook'. | 966 ;; `post-command-hook'. |
945 (add-hook 'post-command-hook 'quail-toggle-mode-temporarily nil t))) | 967 (add-hook 'post-command-hook 'quail-toggle-mode-temporarily nil t))) |