# HG changeset patch # User Miles Bader # Date 972107346 0 # Node ID d22bbff7dad8270aeea55c34a3280c3f18a49f74 # Parent a7f5538886714f0f3d664588b8376418a33aa689 (quail-update-guidance): Use `fit-window-to-buffer' instead of `set-window-text-height'. diff -r a7f553888671 -r d22bbff7dad8 lisp/international/quail.el --- a/lisp/international/quail.el Sat Oct 21 05:40:19 2000 +0000 +++ b/lisp/international/quail.el Sat Oct 21 05:49:06 2000 +0000 @@ -1955,19 +1955,10 @@ ;; 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 @@ (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.