# HG changeset patch # User Kenichi Handa # Date 873817021 0 # Node ID 1c5164d8142658e614e052f47848132fb6a2365e # Parent 68c5c0b3ed0d5c7bd414390e780783927a3359a3 (quail-simple): New function. (quail-require-guidance-buf): New function. (quail-show-guidance-buf): Do not show guidance buffer if simple input method is used in the minibuffer. (quail-update-guidance): Likewise. diff -r 68c5c0b3ed0d -r 1c5164d81426 lisp/international/quail.el --- a/lisp/international/quail.el Tue Sep 09 14:55:29 1997 +0000 +++ b/lisp/international/quail.el Tue Sep 09 14:57:01 1997 +0000 @@ -116,7 +116,7 @@ NAME, TITLE, QUAIL-MAP, GUIDANCE, DOCSTRING, TRANSLATION-KEYS, FORGET-LAST-SELECTION, DETERMINISTIC, KBD-TRANSLATE, SHOW-LAYOUT, DECODE-MAP, MAXIMUM-SHORTEST, OVERLAY-PLIST, UPDATE-TRANSLATION-FUNCTION, - CONVERSION-KEYS. + CONVERSION-KEYS, SIMPLE. QUAIL-MAP is a data structure to map key strings to translations. For the format, see the documentation of `quail-map-p'. @@ -182,6 +182,9 @@ Conversion keymap is a keymap used while conversion region is active but translation region is not active." (nth 14 quail-current-package)) +(defsubst quail-simple () + "Return t if the current Quail package is simple." + (nth 15 quail-current-package)) (defsubst quail-package (name) "Return Quail package named NAME." @@ -455,7 +458,7 @@ forget-last-selection deterministic kbd-translate show-layout (if create-decode-map (list 'decode-map) nil) maximum-shortest overlay-plist update-translation-function - conversion-keymap)) + conversion-keymap simple)) ;; Update input-method-alist. (let ((slot (assoc name input-method-alist)) @@ -1392,6 +1395,13 @@ (setq quail-overlay (make-overlay 1 1)) (overlay-put quail-overlay 'face 'highlight)))) +;; Return t iff the current Quail package requires showing guidance +;; buffer. +(defun quail-require-guidance-buf () + (and input-method-verbose-flag + (not (and (eq (selected-window) (minibuffer-window)) + (quail-simple))))) + (defun quail-show-guidance-buf () "Display a guidance buffer for Quail input method in some window. Create the buffer if it does not exist yet. @@ -1399,10 +1409,7 @@ but if the current buffer is a minibuffer, it is shown in the bottom-most ordinary window of the same frame, or in a newly created frame (if the selected frame has no other windows)." - (if (and (not input-method-verbose-flag) - (eq (selected-window) (minibuffer-window))) - ;; We don't need the guidance buffer. - nil + (when (quail-require-guidance-buf) ;; At first, setup a guidance buffer. (or (buffer-live-p quail-guidance-buf) (setq quail-guidance-buf (generate-new-buffer " *Quail-guidance*"))) @@ -1472,8 +1479,7 @@ (defun quail-update-guidance () "Update the Quail guidance buffer and completion buffer (if displayed now)." ;; Update guidance buffer. - (if (or input-method-verbose-flag - (not (eq (selected-window) (minibuffer-window)))) + (if (quail-require-guidance-buf) (let ((guidance (quail-guidance))) (cond ((or (eq guidance t) (listp guidance))