changeset 19933:e135dd522e64

(quail-terminate-translation): If quail-overlay is not an overlay, don't mess with it.
author Richard M. Stallman <rms@gnu.org>
date Mon, 15 Sep 1997 06:32:36 +0000
parents 2dce5db7cf82
children 486a8046bbf5
files lisp/international/quail.el
diffstat 1 files changed, 20 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/quail.el	Mon Sep 15 06:10:22 1997 +0000
+++ b/lisp/international/quail.el	Mon Sep 15 06:32:36 1997 +0000
@@ -1035,26 +1035,27 @@
 
 (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)