From feb5013d7cb2a3604b0a1f8bab63e57bfb56723a Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Sat, 21 Oct 2000 05:50:56 +0000 Subject: [PATCH] (quail-update-guidance): Use `fit-window-to-buffer' instead of `set-window-text-height'. --- lisp/ChangeLog | 2 ++ lisp/international/quail.el | 28 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 42eebf899ff..0d2620d77c3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -3,6 +3,8 @@ * window.el (fit-window-to-buffer): New function. (shrink-window-if-larger-than-buffer): Use it. * help.el (resize-temp-buffer-window): Use `fit-window-to-buffer'. + * international/quail.el (quail-update-guidance): Use + `fit-window-to-buffer' instead of `set-window-text-height'. * international/quail.el (quail-show-guidance-buf): Make sure guidance window really has enough room. diff --git a/lisp/international/quail.el b/lisp/international/quail.el index 2743126b089..40357e5cbf9 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el @@ -1955,19 +1955,10 @@ or in a newly created frame (if the selected frame has no other windows)." ;; Update guidance buffer. (if (quail-require-guidance-buf) (let ((guidance (quail-guidance))) - (if (not (and (eq (selected-frame) (window-frame (minibuffer-window))) - (eq (selected-frame) (window-frame quail-guidance-win)))) - ;; The guidance window is not show in this frame, show it - (quail-show-guidance-buf) - ;; Make sure the height of the guidance window is OK -- - ;; sometimes, if the minibuffer window expands due to user - ;; input (for instance if the newly inserted character is in a - ;; different font), it will cause the guidance window to be - ;; only partially visible. We force a redisplay first because - ;; this automatic expansion doesn't happen until then, and we - ;; want to see the window sizes after the expansion. - (sit-for 0) - (set-window-text-height quail-guidance-win 1)) + (unless (and (eq (selected-frame) (window-frame (minibuffer-window))) + (eq (selected-frame) (window-frame quail-guidance-win))) + ;; The guidance window is not show in this frame, show it + (quail-show-guidance-buf)) (cond ((or (eq guidance t) (consp guidance)) ;; Show the current possible translations. @@ -1980,7 +1971,16 @@ or in a newly created frame (if the selected frame has no other windows)." (save-excursion (set-buffer quail-guidance-buf) (erase-buffer) - (insert key))))))) + (insert key))))) + ;; Make sure the height of the guidance window is OK -- + ;; sometimes, if the minibuffer window expands due to user + ;; input (for instance if the newly inserted character is in a + ;; different font), it will cause the guidance window to be + ;; only partially visible. We force a redisplay first because + ;; this automatic expansion doesn't happen until then, and we + ;; want to see the window sizes after the expansion. + (sit-for 0) + (fit-window-to-buffer quail-guidance-win nil 1)))) ;; Update completion buffer if displayed now. We highlight the ;; selected candidate string in *Completion* buffer if any. -- 2.39.5