Commit 6b54027b authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(change_window_height): Test for DELTA too small

only after making it smaller based on maxdelta.
parent 555235e6
...@@ -1252,10 +1252,10 @@ window_loop (type, obj, mini, frames) ...@@ -1252,10 +1252,10 @@ window_loop (type, obj, mini, frames)
{ {
struct window *best_window_ptr = XWINDOW (best_window); struct window *best_window_ptr = XWINDOW (best_window);
struct window *w_ptr = XWINDOW (w); struct window *w_ptr = XWINDOW (w);
if (NILP (best_window) || if (NILP (best_window)
(XFASTINT (w_ptr->height) * XFASTINT (w_ptr->width)) || (XFASTINT (w_ptr->height) * XFASTINT (w_ptr->width)
> (XFASTINT (best_window_ptr->height) > (XFASTINT (best_window_ptr->height)
* XFASTINT (best_window_ptr->width))) * XFASTINT (best_window_ptr->width))))
best_window = w; best_window = w;
} }
break; break;
...@@ -2072,12 +2072,6 @@ change_window_height (delta, widthflag) ...@@ -2072,12 +2072,6 @@ change_window_height (delta, widthflag)
sizep = &CURSIZE (window); sizep = &CURSIZE (window);
if (*sizep + delta < MINSIZE (window))
{
Fdelete_window (window);
return;
}
{ {
register int maxdelta; register int maxdelta;
...@@ -2093,13 +2087,19 @@ change_window_height (delta, widthflag) ...@@ -2093,13 +2087,19 @@ change_window_height (delta, widthflag)
the full frame, or make the only window aside from the the full frame, or make the only window aside from the
minibuffer the full frame. */ minibuffer the full frame. */
delta = maxdelta; delta = maxdelta;
}
if (delta == 0) if (*sizep + delta < MINSIZE (window))
{
Fdelete_window (window);
return; return;
} }
if (delta == 0)
return;
if (!NILP (p->next) && if (!NILP (p->next)
(*sizefun) (p->next) - delta >= MINSIZE (p->next)) && (*sizefun) (p->next) - delta >= MINSIZE (p->next))
{ {
(*setsizefun) (p->next, (*sizefun) (p->next) - delta, 0); (*setsizefun) (p->next, (*sizefun) (p->next) - delta, 0);
(*setsizefun) (window, *sizep + delta, 0); (*setsizefun) (window, *sizep + delta, 0);
...@@ -2108,8 +2108,8 @@ change_window_height (delta, widthflag) ...@@ -2108,8 +2108,8 @@ change_window_height (delta, widthflag)
but it propagates the new top edge to its children */ but it propagates the new top edge to its children */
(*setsizefun) (p->next, (*sizefun) (p->next), 0); (*setsizefun) (p->next, (*sizefun) (p->next), 0);
} }
else if (!NILP (p->prev) && else if (!NILP (p->prev)
(*sizefun) (p->prev) - delta >= MINSIZE (p->prev)) && (*sizefun) (p->prev) - delta >= MINSIZE (p->prev))
{ {
(*setsizefun) (p->prev, (*sizefun) (p->prev) - delta, 0); (*setsizefun) (p->prev, (*sizefun) (p->prev) - delta, 0);
CURBEG (window) -= delta; CURBEG (window) -= delta;
...@@ -2713,8 +2713,8 @@ by `current-window-configuration' (which see).") ...@@ -2713,8 +2713,8 @@ by `current-window-configuration' (which see).")
/* As documented in Fcurrent_window_configuration, don't /* As documented in Fcurrent_window_configuration, don't
save the location of point in the buffer which was current save the location of point in the buffer which was current
when the window configuration was recorded. */ when the window configuration was recorded. */
if (!EQ (p->buffer, new_current_buffer) && if (!EQ (p->buffer, new_current_buffer)
XBUFFER (p->buffer) == current_buffer) && XBUFFER (p->buffer) == current_buffer)
Fgoto_char (w->pointm); Fgoto_char (w->pointm);
} }
else if (NILP (w->buffer) || NILP (XBUFFER (w->buffer)->name)) else if (NILP (w->buffer) || NILP (XBUFFER (w->buffer)->name))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment