comparison src/xdisp.c @ 38793:4800b18d484f

(resize_echo_area_exactly): Don't resize the mini-window exactly when a mini-buffer is active.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 13 Aug 2001 09:52:55 +0000
parents 258f3e803e75
children 9c6ef0fd5c4d
comparison
equal deleted inserted replaced
38792:c9b9238088f3 38793:4800b18d484f
6454 return window_height_changed_p; 6454 return window_height_changed_p;
6455 } 6455 }
6456 6456
6457 6457
6458 /* Resize the echo area window to exactly the size needed for the 6458 /* Resize the echo area window to exactly the size needed for the
6459 currently displayed message, if there is one. */ 6459 currently displayed message, if there is one. If a mini-buffer
6460 is active, don't shrink it. */
6460 6461
6461 void 6462 void
6462 resize_echo_area_exactly () 6463 resize_echo_area_exactly ()
6463 { 6464 {
6464 if (BUFFERP (echo_area_buffer[0]) 6465 if (BUFFERP (echo_area_buffer[0])
6465 && WINDOWP (echo_area_window)) 6466 && WINDOWP (echo_area_window))
6466 { 6467 {
6467 struct window *w = XWINDOW (echo_area_window); 6468 struct window *w = XWINDOW (echo_area_window);
6468 int resized_p; 6469 int resized_p;
6470 Lisp_Object resize_exactly;
6471
6472 if (minibuf_level == 0)
6473 resize_exactly = Qt;
6474 else
6475 resize_exactly = Qnil;
6469 6476
6470 resized_p = with_echo_area_buffer (w, 0, resize_mini_window_1, 6477 resized_p = with_echo_area_buffer (w, 0, resize_mini_window_1,
6471 (EMACS_INT) w, Qnil, 0, 0); 6478 (EMACS_INT) w, resize_exactly, 0, 0);
6472 if (resized_p) 6479 if (resized_p)
6473 { 6480 {
6474 ++windows_or_buffers_changed; 6481 ++windows_or_buffers_changed;
6475 ++update_mode_lines; 6482 ++update_mode_lines;
6476 redisplay_internal (0); 6483 redisplay_internal (0);
6479 } 6486 }
6480 6487
6481 6488
6482 /* Callback function for with_echo_area_buffer, when used from 6489 /* Callback function for with_echo_area_buffer, when used from
6483 resize_echo_area_exactly. A1 contains a pointer to the window to 6490 resize_echo_area_exactly. A1 contains a pointer to the window to
6484 resize, A2 to A4 are not used. Value is what resize_mini_window 6491 resize, EXACTLY non-nil means resize the mini-window exactly to the
6485 returns. */ 6492 size of the text displayed. A3 and A4 are not used. Value is what
6493 resize_mini_window returns. */
6486 6494
6487 static int 6495 static int
6488 resize_mini_window_1 (a1, a2, a3, a4) 6496 resize_mini_window_1 (a1, exactly, a3, a4)
6489 EMACS_INT a1; 6497 EMACS_INT a1;
6490 Lisp_Object a2; 6498 Lisp_Object exactly;
6491 EMACS_INT a3, a4; 6499 EMACS_INT a3, a4;
6492 { 6500 {
6493 return resize_mini_window ((struct window *) a1, 1); 6501 return resize_mini_window ((struct window *) a1, !NILP (exactly));
6494 } 6502 }
6495 6503
6496 6504
6497 /* Resize mini-window W to fit the size of its contents. EXACT:P 6505 /* Resize mini-window W to fit the size of its contents. EXACT:P
6498 means size the window exactly to the size needed. Otherwise, it's 6506 means size the window exactly to the size needed. Otherwise, it's