diff options
| author | Richard M. Stallman | 1997-09-15 06:32:36 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-09-15 06:32:36 +0000 |
| commit | 7543131adb9deaf4950f781ec75bba4d02957f4e (patch) | |
| tree | af323cd1ad4d0270e4ebeaad2e4129d5c5dfc41e /lisp | |
| parent | b55dd0a7ba14091156f970abcd70f023fec4ed7d (diff) | |
| download | emacs-7543131adb9deaf4950f781ec75bba4d02957f4e.tar.gz emacs-7543131adb9deaf4950f781ec75bba4d02957f4e.zip | |
(quail-terminate-translation):
If quail-overlay is not an overlay, don't mess with it.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/international/quail.el | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/lisp/international/quail.el b/lisp/international/quail.el index bfc77ab0876..1a344ec3182 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el | |||
| @@ -1035,26 +1035,27 @@ The returned value is a Quail map specific to KEY." | |||
| 1035 | 1035 | ||
| 1036 | (defun quail-terminate-translation () | 1036 | (defun quail-terminate-translation () |
| 1037 | "Terminate the translation of the current key." | 1037 | "Terminate the translation of the current key." |
| 1038 | (let ((start (overlay-start quail-overlay))) | 1038 | (when (overlayp quail-overlay) |
| 1039 | (if (and start | 1039 | (let ((start (overlay-start quail-overlay))) |
| 1040 | (< start (overlay-end quail-overlay))) | 1040 | (if (and start |
| 1041 | ;; Here we simulate self-insert-command. | 1041 | (< start (overlay-end quail-overlay))) |
| 1042 | (let ((seq (string-to-sequence | 1042 | ;; Here we simulate self-insert-command. |
| 1043 | (buffer-substring (overlay-start quail-overlay) | 1043 | (let ((seq (string-to-sequence |
| 1044 | (overlay-end quail-overlay)) | 1044 | (buffer-substring (overlay-start quail-overlay) |
| 1045 | 'list)) | 1045 | (overlay-end quail-overlay)) |
| 1046 | last-command-char) | 1046 | 'list)) |
| 1047 | (goto-char start) | 1047 | last-command-char) |
| 1048 | (quail-delete-region) | 1048 | (goto-char start) |
| 1049 | (setq last-command-char (car seq)) | 1049 | (quail-delete-region) |
| 1050 | (self-insert-command (or quail-prefix-arg 1)) | ||
| 1051 | (setq quail-prefix-arg nil) | ||
| 1052 | (setq seq (cdr seq)) | ||
| 1053 | (while seq | ||
| 1054 | (setq last-command-char (car seq)) | 1050 | (setq last-command-char (car seq)) |
| 1055 | (self-insert-command 1) | 1051 | (self-insert-command (or quail-prefix-arg 1)) |
| 1056 | (setq seq (cdr seq)))))) | 1052 | (setq quail-prefix-arg nil) |
| 1057 | (delete-overlay quail-overlay) | 1053 | (setq seq (cdr seq)) |
| 1054 | (while seq | ||
| 1055 | (setq last-command-char (car seq)) | ||
| 1056 | (self-insert-command 1) | ||
| 1057 | (setq seq (cdr seq)))))) | ||
| 1058 | (delete-overlay quail-overlay)) | ||
| 1058 | (if (buffer-live-p quail-guidance-buf) | 1059 | (if (buffer-live-p quail-guidance-buf) |
| 1059 | (save-excursion | 1060 | (save-excursion |
| 1060 | (set-buffer quail-guidance-buf) | 1061 | (set-buffer quail-guidance-buf) |