From 6d004fea41c6bcc9cea3730b50d7ccaba5d164c3 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Mon, 13 Aug 2001 09:52:55 +0000 Subject: [PATCH] (resize_echo_area_exactly): Don't resize the mini-window exactly when a mini-buffer is active. --- src/xdisp.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index 4d51cc4bdca..10e7abe1ddb 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -6456,7 +6456,8 @@ display_echo_area_1 (a1, a2, a3, a4) /* Resize the echo area window to exactly the size needed for the - currently displayed message, if there is one. */ + currently displayed message, if there is one. If a mini-buffer + is active, don't shrink it. */ void resize_echo_area_exactly () @@ -6466,9 +6467,15 @@ resize_echo_area_exactly () { struct window *w = XWINDOW (echo_area_window); int resized_p; + Lisp_Object resize_exactly; + + if (minibuf_level == 0) + resize_exactly = Qt; + else + resize_exactly = Qnil; resized_p = with_echo_area_buffer (w, 0, resize_mini_window_1, - (EMACS_INT) w, Qnil, 0, 0); + (EMACS_INT) w, resize_exactly, 0, 0); if (resized_p) { ++windows_or_buffers_changed; @@ -6481,16 +6488,17 @@ resize_echo_area_exactly () /* Callback function for with_echo_area_buffer, when used from resize_echo_area_exactly. A1 contains a pointer to the window to - resize, A2 to A4 are not used. Value is what resize_mini_window - returns. */ + resize, EXACTLY non-nil means resize the mini-window exactly to the + size of the text displayed. A3 and A4 are not used. Value is what + resize_mini_window returns. */ static int -resize_mini_window_1 (a1, a2, a3, a4) +resize_mini_window_1 (a1, exactly, a3, a4) EMACS_INT a1; - Lisp_Object a2; + Lisp_Object exactly; EMACS_INT a3, a4; { - return resize_mini_window ((struct window *) a1, 1); + return resize_mini_window ((struct window *) a1, !NILP (exactly)); } -- 2.39.2