changeset 23599:ab69e7987be0

(quail-start-translation): Handle switching of the frame in read-key-sequence. (quail-start-conversion): Likewise. (quail-show-guidance-buf): Detach quail-guidance-buf from any windows before setting an appropriate window for it. (quail-hide-guidance-buf): Use window-minibuffer-p. Set quail-guidance-win to nil. (quail-update-guidance): If quail-guidance-buf is not in the selected frame, call quail-show-guidance-buf again.
author Kenichi Handa <handa@m17n.org>
date Sat, 31 Oct 1998 05:12:07 +0000
parents 118a5f3c79de
children db1ded871074
files lisp/international/quail.el
diffstat 1 files changed, 18 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/quail.el	Sat Oct 31 05:12:07 1998 +0000
+++ b/lisp/international/quail.el	Sat Oct 31 05:12:07 1998 +0000
@@ -941,7 +941,8 @@
 	  (let* ((keyseq (read-key-sequence
 			  (and input-method-use-echo-area
 			       (concat input-method-previous-message
-				       quail-current-str))))
+				       quail-current-str))
+			  nil nil t))
 		 (cmd (lookup-key (quail-translation-keymap) keyseq)))
 	    (if (if key
 		    (and (commandp cmd) (not (eq cmd 'quail-other-command)))
@@ -1007,7 +1008,8 @@
 			  (and input-method-use-echo-area
 			       (concat input-method-previous-message
 				       quail-conversion-str
-				       quail-current-str))))
+				       quail-current-str))
+			  nil nil t))
 		 (cmd (lookup-key (quail-conversion-keymap) keyseq)))
 	    (if (if key (commandp cmd) (eq cmd 'quail-self-insert-command))
 		(progn
@@ -1478,6 +1480,14 @@
 	(set-buffer-modified-p nil)))
     (bury-buffer quail-guidance-buf)
 
+    ;; Assign the buffer " *Minibuf-N*" to all windows which are now
+    ;; displaying quail-guidance-buf.
+    (let ((win-list (get-buffer-window-list quail-guidance-buf t t)))
+      (while win-list
+	(set-window-buffer (car win-list)
+			   (format " *Minibuf-%d*" (minibuffer-depth)))
+	(setq win-list (cdr win-list))))
+
     ;; Then, display it in an appropriate window.
     (let ((win (minibuffer-window)))
       (if (or (eq (selected-window) win)
@@ -1515,7 +1525,7 @@
 	    win)
 	(while win-list
 	  (setq win (car win-list) win-list (cdr win-list))
-	  (if (eq win (minibuffer-window))
+	  (if (window-minibuffer-p win)
 	      ;; We are using echo area for the guidance buffer.
 	      ;; Vacate it to the deepest minibuffer.
 	      (set-window-buffer win
@@ -1526,13 +1536,17 @@
 		  ;;(set-window-dedicated-p win nil)
 		  (delete-frame (window-frame win)))
 	      ;;(set-window-dedicated-p win nil)
-	      (delete-window win)))))))
+	      (delete-window win))))
+	(setq quail-guidance-win nil))))
 
 (defun quail-update-guidance ()
   "Update the Quail guidance buffer and completion buffer (if displayed now)."
   ;; Update guidance buffer.
   (if (quail-require-guidance-buf)
       (let ((guidance (quail-guidance)))
+	(or (and (eq (selected-frame) (window-frame (minibuffer-window)))
+		 (eq (selected-frame) (window-frame quail-guidance-win)))
+	    (quail-show-guidance-buf))
 	(cond ((or (eq guidance t)
 		   (consp guidance))
 	       ;; Show the current possible translations.