static void window_scroll P_ ((Lisp_Object, int, int, int));
static void window_scroll_pixel_based P_ ((Lisp_Object, int, int, int));
static void window_scroll_line_based P_ ((Lisp_Object, int, int, int));
-
+static int window_min_size P_ ((struct window *, int));
/* This is the window in which the terminal's cursor should
*cols = MIN_SAFE_WINDOW_WIDTH;
}
+
+/* Return the minimum size of window W. WIDTH_P non-zero means
+ return the minimum width, otherwise return the minimum height. */
+
+static INLINE int
+window_min_size (w, width_p)
+ struct window *w;
+ int width_p;
+{
+ int size;
+
+ if (width_p)
+ size = window_min_width;
+ else
+ {
+ if (MINI_WINDOW_P (w)
+ || (!WINDOW_WANTS_MODELINE_P (w)
+ && !WINDOW_WANTS_TOP_LINE_P (w)))
+ size = 1;
+ else
+ size = window_min_height;
+ }
+
+ return size;
+}
+
+
/* Normally the window is deleted if it gets too small. nodelete
nonzero means do not do this. (The caller should check later and
do so if appropriate) */
check_min_window_sizes ();
- if (!nodelete
- && ! NILP (w->parent)
- && (MINI_WINDOW_P (w)
- ? height < 1
- : height < window_min_height))
+ if (!nodelete && !NILP (w->parent))
{
- delete_window (window);
- return;
+ int min_height = window_min_size (w, 0);
+ if (height < min_height)
+ {
+ delete_window (window);
+ return;
+ }
}
XSETFASTINT (w->last_modified, 0);
return XFASTINT (p->width);
}
-#define MINSIZE(w) \
- (widthflag \
- ? window_min_width \
- : (MINI_WINDOW_P (XWINDOW (w)) ? 1 : window_min_height))
-
+
#define CURBEG(w) \
*(widthflag ? (int *) &(XWINDOW (w)->left) : (int *) &(XWINDOW (w)->top))
register int maxdelta;
maxdelta = (!NILP (parent) ? (*sizefun) (parent) - *sizep
- : !NILP (p->next) ? (*sizefun) (p->next) - MINSIZE (p->next)
- : !NILP (p->prev) ? (*sizefun) (p->prev) - MINSIZE (p->prev)
+ : !NILP (p->next) ? ((*sizefun) (p->next)
+ - window_min_size (XWINDOW (p->next),
+ widthflag))
+ : !NILP (p->prev) ? ((*sizefun) (p->prev)
+ - window_min_size (XWINDOW (p->prev),
+ widthflag))
/* This is a frame with only one window, a minibuffer-only
or a minibufferless frame. */
: (delta = 0));
delta = maxdelta;
}
- if (*sizep + delta < MINSIZE (window))
+ if (*sizep + delta < window_min_size (XWINDOW (window), widthflag))
{
delete_window (window);
return;
/* Find the total we can get from other siblings. */
maximum = 0;
for (next = p->next; ! NILP (next); next = XWINDOW (next)->next)
- maximum += (*sizefun) (next) - MINSIZE (next);
+ maximum += (*sizefun) (next) - window_min_size (XWINDOW (next),
+ widthflag);
for (prev = p->prev; ! NILP (prev); prev = XWINDOW (prev)->prev)
- maximum += (*sizefun) (prev) - MINSIZE (prev);
+ maximum += (*sizefun) (prev) - window_min_size (XWINDOW (prev),
+ widthflag);
/* If we can get it all from them, do so. */
if (delta <= maximum)
break;
if (! NILP (next))
{
- int this_one = (*sizefun) (next) - MINSIZE (next);
+ int this_one = ((*sizefun) (next)
+ - window_min_size (XWINDOW (next), widthflag));
if (this_one > delta)
this_one = delta;
break;
if (! NILP (prev))
{
- int this_one = (*sizefun) (prev) - MINSIZE (prev);
+ int this_one = ((*sizefun) (prev)
+ - window_min_size (XWINDOW (prev), widthflag));
if (this_one > delta)
this_one = delta;
/* Adjust glyph matrices. */
adjust_glyphs (XFRAME (WINDOW_FRAME (XWINDOW (window))));
}
-#undef MINSIZE
+
#undef CURBEG
#undef CURSIZE