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
{
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;
}
}
}
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);
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);
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))
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");
}
-/* 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)
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);
+ }
}