Mercurial > emacs
changeset 25797:0d73a1e7b7f2
(enlarge_window): Add window parameter instead of using
selected_window.
(Fdisplay_buffer): Call it with window parameter instead of
setting selected_window.
(Fenlarge_window, Fshrink_window): Ditto.
(shrink_mini_window): If there is no recorded height and position
info, resize mini-window to height 1.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Thu, 23 Sep 1999 22:17:37 +0000 |
parents | 952b7a2a3d91 |
children | 775d0eca0cc3 |
files | src/window.c |
diffstat | 1 files changed, 18 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/src/window.c Thu Sep 23 22:17:36 1999 +0000 +++ b/src/window.c Thu Sep 23 22:17:37 1999 +0000 @@ -60,7 +60,7 @@ int, int)); static void freeze_window_start P_ ((struct window *, int)); static int window_fixed_size_p P_ ((struct window *, int, int)); -static void enlarge_window P_ ((int, int)); +static void enlarge_window P_ ((Lisp_Object, int, int)); /* This is the window in which the terminal's cursor should @@ -2789,14 +2789,9 @@ { int total = (XFASTINT (XWINDOW (other)->height) + XFASTINT (XWINDOW (window)->height)); - Lisp_Object old_selected_window; - old_selected_window = selected_window; - - selected_window = upper; - enlarge_window ((total / 2 - - XFASTINT (XWINDOW (upper)->height)), + enlarge_window (upper, + total / 2 - XFASTINT (XWINDOW (upper)->height), 0); - selected_window = old_selected_window; } } } @@ -3030,7 +3025,7 @@ register Lisp_Object arg, side; { CHECK_NUMBER (arg, 0); - enlarge_window (XINT (arg), !NILP (side)); + enlarge_window (selected_window, XINT (arg), !NILP (side)); if (! NILP (Vwindow_configuration_change_hook)) call1 (Vrun_hooks, Qwindow_configuration_change_hook); @@ -3045,7 +3040,7 @@ register Lisp_Object arg, side; { CHECK_NUMBER (arg, 0); - enlarge_window (-XINT (arg), !NILP (side)); + enlarge_window (selected_window, -XINT (arg), !NILP (side)); if (! NILP (Vwindow_configuration_change_hook)) call1 (Vrun_hooks, Qwindow_configuration_change_hook); @@ -3083,10 +3078,11 @@ they will be deleted. */ static void -enlarge_window (delta, widthflag) +enlarge_window (window, delta, widthflag) + Lisp_Object window; int delta, widthflag; { - Lisp_Object parent, window, next, prev; + Lisp_Object parent, next, prev; struct window *p; int *sizep, maximum; int (*sizefun) P_ ((Lisp_Object)) @@ -3099,7 +3095,6 @@ check_min_window_sizes (); /* Give up if this window cannot be resized. */ - window = selected_window; if (window_fixed_size_p (XWINDOW (window), widthflag, 1)) error ("Window is not resizable"); @@ -3483,9 +3478,10 @@ } -/* Shrink mini-window W back to its original size before the first - call to grow_mini_window. Resize other windows on the same frame - back to their original size. */ +/* Shrink mini-window W. If there is recorded info about window sizes + before a call to grow_mini_window, restore recorded window sizes. + Otherwise, if the mini-window is higher than 1 line, resize it to 1 + line. */ void shrink_mini_window (w) @@ -3501,6 +3497,12 @@ FRAME_WINDOW_SIZES_CHANGED (f) = 1; windows_or_buffers_changed = 1; } + else if (XFASTINT (w->height) > 1) + { + Lisp_Object window; + XSETWINDOW (window, w); + enlarge_window (window, 1 - XFASTINT (w->height), 0); + } }