1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-17 10:06:13 +00:00

(quail-terminate-translation):

If quail-overlay is not an overlay, don't mess with it.
This commit is contained in:
Richard M. Stallman 1997-09-15 06:32:36 +00:00
parent b55dd0a7ba
commit 7543131adb

View File

@ -1035,26 +1035,27 @@ The returned value is a Quail map specific to KEY."
(defun quail-terminate-translation ()
"Terminate the translation of the current key."
(let ((start (overlay-start quail-overlay)))
(if (and start
(< start (overlay-end quail-overlay)))
;; Here we simulate self-insert-command.
(let ((seq (string-to-sequence
(buffer-substring (overlay-start quail-overlay)
(overlay-end quail-overlay))
'list))
last-command-char)
(goto-char start)
(quail-delete-region)
(setq last-command-char (car seq))
(self-insert-command (or quail-prefix-arg 1))
(setq quail-prefix-arg nil)
(setq seq (cdr seq))
(while seq
(when (overlayp quail-overlay)
(let ((start (overlay-start quail-overlay)))
(if (and start
(< start (overlay-end quail-overlay)))
;; Here we simulate self-insert-command.
(let ((seq (string-to-sequence
(buffer-substring (overlay-start quail-overlay)
(overlay-end quail-overlay))
'list))
last-command-char)
(goto-char start)
(quail-delete-region)
(setq last-command-char (car seq))
(self-insert-command 1)
(setq seq (cdr seq))))))
(delete-overlay quail-overlay)
(self-insert-command (or quail-prefix-arg 1))
(setq quail-prefix-arg nil)
(setq seq (cdr seq))
(while seq
(setq last-command-char (car seq))
(self-insert-command 1)
(setq seq (cdr seq))))))
(delete-overlay quail-overlay))
(if (buffer-live-p quail-guidance-buf)
(save-excursion
(set-buffer quail-guidance-buf)