diff options
| author | Kenichi Handa | 1997-09-09 14:57:01 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1997-09-09 14:57:01 +0000 |
| commit | b55ba0277ecdab6eeacf0527caaa3015f9398362 (patch) | |
| tree | a13e5783293db350752ee48593722df616e5967d | |
| parent | c27c4ed8d62766618dd90166defcdbf525fb02f5 (diff) | |
| download | emacs-b55ba0277ecdab6eeacf0527caaa3015f9398362.tar.gz emacs-b55ba0277ecdab6eeacf0527caaa3015f9398362.zip | |
(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.
| -rw-r--r-- | lisp/international/quail.el | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/lisp/international/quail.el b/lisp/international/quail.el index b6723bfbb0b..50d85676fdc 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el | |||
| @@ -116,7 +116,7 @@ A Quail package is a list of these elements: | |||
| 116 | NAME, TITLE, QUAIL-MAP, GUIDANCE, DOCSTRING, TRANSLATION-KEYS, | 116 | NAME, TITLE, QUAIL-MAP, GUIDANCE, DOCSTRING, TRANSLATION-KEYS, |
| 117 | FORGET-LAST-SELECTION, DETERMINISTIC, KBD-TRANSLATE, SHOW-LAYOUT, | 117 | FORGET-LAST-SELECTION, DETERMINISTIC, KBD-TRANSLATE, SHOW-LAYOUT, |
| 118 | DECODE-MAP, MAXIMUM-SHORTEST, OVERLAY-PLIST, UPDATE-TRANSLATION-FUNCTION, | 118 | DECODE-MAP, MAXIMUM-SHORTEST, OVERLAY-PLIST, UPDATE-TRANSLATION-FUNCTION, |
| 119 | CONVERSION-KEYS. | 119 | CONVERSION-KEYS, SIMPLE. |
| 120 | 120 | ||
| 121 | QUAIL-MAP is a data structure to map key strings to translations. For | 121 | QUAIL-MAP is a data structure to map key strings to translations. For |
| 122 | the format, see the documentation of `quail-map-p'. | 122 | the format, see the documentation of `quail-map-p'. |
| @@ -182,6 +182,9 @@ See also the documentation of `quail-define-package'." | |||
| 182 | Conversion keymap is a keymap used while conversion region is active | 182 | Conversion keymap is a keymap used while conversion region is active |
| 183 | but translation region is not active." | 183 | but translation region is not active." |
| 184 | (nth 14 quail-current-package)) | 184 | (nth 14 quail-current-package)) |
| 185 | (defsubst quail-simple () | ||
| 186 | "Return t if the current Quail package is simple." | ||
| 187 | (nth 15 quail-current-package)) | ||
| 185 | 188 | ||
| 186 | (defsubst quail-package (name) | 189 | (defsubst quail-package (name) |
| 187 | "Return Quail package named NAME." | 190 | "Return Quail package named NAME." |
| @@ -455,7 +458,7 @@ non-Quail commands." | |||
| 455 | forget-last-selection deterministic kbd-translate show-layout | 458 | forget-last-selection deterministic kbd-translate show-layout |
| 456 | (if create-decode-map (list 'decode-map) nil) | 459 | (if create-decode-map (list 'decode-map) nil) |
| 457 | maximum-shortest overlay-plist update-translation-function | 460 | maximum-shortest overlay-plist update-translation-function |
| 458 | conversion-keymap)) | 461 | conversion-keymap simple)) |
| 459 | 462 | ||
| 460 | ;; Update input-method-alist. | 463 | ;; Update input-method-alist. |
| 461 | (let ((slot (assoc name input-method-alist)) | 464 | (let ((slot (assoc name input-method-alist)) |
| @@ -1392,6 +1395,13 @@ Remaining args are for FUNC." | |||
| 1392 | (setq quail-overlay (make-overlay 1 1)) | 1395 | (setq quail-overlay (make-overlay 1 1)) |
| 1393 | (overlay-put quail-overlay 'face 'highlight)))) | 1396 | (overlay-put quail-overlay 'face 'highlight)))) |
| 1394 | 1397 | ||
| 1398 | ;; Return t iff the current Quail package requires showing guidance | ||
| 1399 | ;; buffer. | ||
| 1400 | (defun quail-require-guidance-buf () | ||
| 1401 | (and input-method-verbose-flag | ||
| 1402 | (not (and (eq (selected-window) (minibuffer-window)) | ||
| 1403 | (quail-simple))))) | ||
| 1404 | |||
| 1395 | (defun quail-show-guidance-buf () | 1405 | (defun quail-show-guidance-buf () |
| 1396 | "Display a guidance buffer for Quail input method in some window. | 1406 | "Display a guidance buffer for Quail input method in some window. |
| 1397 | Create the buffer if it does not exist yet. | 1407 | Create the buffer if it does not exist yet. |
| @@ -1399,10 +1409,7 @@ The buffer is normally displayed at the echo area, | |||
| 1399 | but if the current buffer is a minibuffer, it is shown in | 1409 | but if the current buffer is a minibuffer, it is shown in |
| 1400 | the bottom-most ordinary window of the same frame, | 1410 | the bottom-most ordinary window of the same frame, |
| 1401 | or in a newly created frame (if the selected frame has no other windows)." | 1411 | or in a newly created frame (if the selected frame has no other windows)." |
| 1402 | (if (and (not input-method-verbose-flag) | 1412 | (when (quail-require-guidance-buf) |
| 1403 | (eq (selected-window) (minibuffer-window))) | ||
| 1404 | ;; We don't need the guidance buffer. | ||
| 1405 | nil | ||
| 1406 | ;; At first, setup a guidance buffer. | 1413 | ;; At first, setup a guidance buffer. |
| 1407 | (or (buffer-live-p quail-guidance-buf) | 1414 | (or (buffer-live-p quail-guidance-buf) |
| 1408 | (setq quail-guidance-buf (generate-new-buffer " *Quail-guidance*"))) | 1415 | (setq quail-guidance-buf (generate-new-buffer " *Quail-guidance*"))) |
| @@ -1472,8 +1479,7 @@ or in a newly created frame (if the selected frame has no other windows)." | |||
| 1472 | (defun quail-update-guidance () | 1479 | (defun quail-update-guidance () |
| 1473 | "Update the Quail guidance buffer and completion buffer (if displayed now)." | 1480 | "Update the Quail guidance buffer and completion buffer (if displayed now)." |
| 1474 | ;; Update guidance buffer. | 1481 | ;; Update guidance buffer. |
| 1475 | (if (or input-method-verbose-flag | 1482 | (if (quail-require-guidance-buf) |
| 1476 | (not (eq (selected-window) (minibuffer-window)))) | ||
| 1477 | (let ((guidance (quail-guidance))) | 1483 | (let ((guidance (quail-guidance))) |
| 1478 | (cond ((or (eq guidance t) | 1484 | (cond ((or (eq guidance t) |
| 1479 | (listp guidance)) | 1485 | (listp guidance)) |