Mercurial > emacs
comparison lisp/international/quail.el @ 32708:d22bbff7dad8
(quail-update-guidance):
Use `fit-window-to-buffer' instead of `set-window-text-height'.
author | Miles Bader <miles@gnu.org> |
---|---|
date | Sat, 21 Oct 2000 05:49:06 +0000 |
parents | a08ba216f051 |
children | b1d56a204fe6 |
comparison
equal
deleted
inserted
replaced
32707:a7f553888671 | 32708:d22bbff7dad8 |
---|---|
1953 (defun quail-update-guidance () | 1953 (defun quail-update-guidance () |
1954 "Update the Quail guidance buffer and completion buffer (if displayed now)." | 1954 "Update the Quail guidance buffer and completion buffer (if displayed now)." |
1955 ;; Update guidance buffer. | 1955 ;; Update guidance buffer. |
1956 (if (quail-require-guidance-buf) | 1956 (if (quail-require-guidance-buf) |
1957 (let ((guidance (quail-guidance))) | 1957 (let ((guidance (quail-guidance))) |
1958 (if (not (and (eq (selected-frame) (window-frame (minibuffer-window))) | 1958 (unless (and (eq (selected-frame) (window-frame (minibuffer-window))) |
1959 (eq (selected-frame) (window-frame quail-guidance-win)))) | 1959 (eq (selected-frame) (window-frame quail-guidance-win))) |
1960 ;; The guidance window is not show in this frame, show it | 1960 ;; The guidance window is not show in this frame, show it |
1961 (quail-show-guidance-buf) | 1961 (quail-show-guidance-buf)) |
1962 ;; Make sure the height of the guidance window is OK -- | |
1963 ;; sometimes, if the minibuffer window expands due to user | |
1964 ;; input (for instance if the newly inserted character is in a | |
1965 ;; different font), it will cause the guidance window to be | |
1966 ;; only partially visible. We force a redisplay first because | |
1967 ;; this automatic expansion doesn't happen until then, and we | |
1968 ;; want to see the window sizes after the expansion. | |
1969 (sit-for 0) | |
1970 (set-window-text-height quail-guidance-win 1)) | |
1971 (cond ((or (eq guidance t) | 1962 (cond ((or (eq guidance t) |
1972 (consp guidance)) | 1963 (consp guidance)) |
1973 ;; Show the current possible translations. | 1964 ;; Show the current possible translations. |
1974 (quail-show-translations)) | 1965 (quail-show-translations)) |
1975 ((null guidance) | 1966 ((null guidance) |
1978 (if (quail-kbd-translate) | 1969 (if (quail-kbd-translate) |
1979 (setq key (quail-keyseq-translate key))) | 1970 (setq key (quail-keyseq-translate key))) |
1980 (save-excursion | 1971 (save-excursion |
1981 (set-buffer quail-guidance-buf) | 1972 (set-buffer quail-guidance-buf) |
1982 (erase-buffer) | 1973 (erase-buffer) |
1983 (insert key))))))) | 1974 (insert key))))) |
1975 ;; Make sure the height of the guidance window is OK -- | |
1976 ;; sometimes, if the minibuffer window expands due to user | |
1977 ;; input (for instance if the newly inserted character is in a | |
1978 ;; different font), it will cause the guidance window to be | |
1979 ;; only partially visible. We force a redisplay first because | |
1980 ;; this automatic expansion doesn't happen until then, and we | |
1981 ;; want to see the window sizes after the expansion. | |
1982 (sit-for 0) | |
1983 (fit-window-to-buffer quail-guidance-win nil 1)))) | |
1984 | 1984 |
1985 ;; Update completion buffer if displayed now. We highlight the | 1985 ;; Update completion buffer if displayed now. We highlight the |
1986 ;; selected candidate string in *Completion* buffer if any. | 1986 ;; selected candidate string in *Completion* buffer if any. |
1987 (let ((win (get-buffer-window quail-completion-buf)) | 1987 (let ((win (get-buffer-window quail-completion-buf)) |
1988 key str pos) | 1988 key str pos) |