diff options
| -rw-r--r-- | lisp/international/quail.el | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/lisp/international/quail.el b/lisp/international/quail.el index c36f022796d..995ce40fd84 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el | |||
| @@ -1637,16 +1637,31 @@ All possible translations of the current key and whole possible longer keys | |||
| 1637 | are shown." | 1637 | are shown." |
| 1638 | (interactive) | 1638 | (interactive) |
| 1639 | (quail-setup-completion-buf) | 1639 | (quail-setup-completion-buf) |
| 1640 | (let ((key quail-current-key) | 1640 | (let ((win (get-buffer-window quail-completion-buf 'visible)) |
| 1641 | (map (quail-lookup-key quail-current-key))) | 1641 | (key quail-current-key) |
| 1642 | (map (quail-lookup-key quail-current-key)) | ||
| 1643 | (require-update nil)) | ||
| 1642 | (save-excursion | 1644 | (save-excursion |
| 1643 | (set-buffer quail-completion-buf) | 1645 | (set-buffer quail-completion-buf) |
| 1644 | (erase-buffer) | 1646 | (if (and win |
| 1645 | (insert "Possible completion and corresponding translations are:\n") | 1647 | (equal key quail-current-key) |
| 1646 | (quail-completion-1 key map 1) | 1648 | (eq last-command 'quail-completion)) |
| 1647 | (goto-char (point-min)) | 1649 | ;; The window for Quail completion buffer has already been |
| 1648 | (display-buffer (current-buffer))) | 1650 | ;; shown. We just scroll it appropriately. |
| 1649 | (quail-update-guidance))) | 1651 | (if (pos-visible-in-window-p (point-max) win) |
| 1652 | (set-window-start win (point-min)) | ||
| 1653 | (let ((other-window-scroll-buffer quail-completion-buf)) | ||
| 1654 | (scroll-other-window))) | ||
| 1655 | (setq quail-current-key key) | ||
| 1656 | (erase-buffer) | ||
| 1657 | (insert "Possible completion and corresponding translations are:\n") | ||
| 1658 | (quail-completion-1 key map 1) | ||
| 1659 | (goto-char (point-min)) | ||
| 1660 | (display-buffer (current-buffer)) | ||
| 1661 | (setq require-update t))) | ||
| 1662 | (if require-update | ||
| 1663 | (quail-update-guidance))) | ||
| 1664 | (setq this-command 'quail-completion)) | ||
| 1650 | 1665 | ||
| 1651 | ;; List all completions of KEY in MAP with indentation INDENT. | 1666 | ;; List all completions of KEY in MAP with indentation INDENT. |
| 1652 | (defun quail-completion-1 (key map indent) | 1667 | (defun quail-completion-1 (key map indent) |