comparison src/window.c @ 7618:45298374e242

(change_window_height): Test for DELTA too small only after making it smaller based on maxdelta.
author Richard M. Stallman <rms@gnu.org>
date Sun, 22 May 1994 08:30:57 +0000
parents 0e1f3b9598bb
children d93dff6fbc73
comparison
equal deleted inserted replaced
7617:edc853e14f7b 7618:45298374e242
1250 || !NILP (XWINDOW (w)->dedicated)) 1250 || !NILP (XWINDOW (w)->dedicated))
1251 break; 1251 break;
1252 { 1252 {
1253 struct window *best_window_ptr = XWINDOW (best_window); 1253 struct window *best_window_ptr = XWINDOW (best_window);
1254 struct window *w_ptr = XWINDOW (w); 1254 struct window *w_ptr = XWINDOW (w);
1255 if (NILP (best_window) || 1255 if (NILP (best_window)
1256 (XFASTINT (w_ptr->height) * XFASTINT (w_ptr->width)) 1256 || (XFASTINT (w_ptr->height) * XFASTINT (w_ptr->width)
1257 > (XFASTINT (best_window_ptr->height) 1257 > (XFASTINT (best_window_ptr->height)
1258 * XFASTINT (best_window_ptr->width))) 1258 * XFASTINT (best_window_ptr->width))))
1259 best_window = w; 1259 best_window = w;
1260 } 1260 }
1261 break; 1261 break;
1262 1262
1263 case UNSHOW_BUFFER: 1263 case UNSHOW_BUFFER:
2070 window = parent; 2070 window = parent;
2071 } 2071 }
2072 2072
2073 sizep = &CURSIZE (window); 2073 sizep = &CURSIZE (window);
2074 2074
2075 if (*sizep + delta < MINSIZE (window))
2076 {
2077 Fdelete_window (window);
2078 return;
2079 }
2080
2081 { 2075 {
2082 register int maxdelta; 2076 register int maxdelta;
2083 2077
2084 maxdelta = (!NILP (parent) ? (*sizefun) (parent) - *sizep 2078 maxdelta = (!NILP (parent) ? (*sizefun) (parent) - *sizep
2085 : !NILP (p->next) ? (*sizefun) (p->next) - MINSIZE (p->next) 2079 : !NILP (p->next) ? (*sizefun) (p->next) - MINSIZE (p->next)
2091 if (delta > maxdelta) 2085 if (delta > maxdelta)
2092 /* This case traps trying to make the minibuffer 2086 /* This case traps trying to make the minibuffer
2093 the full frame, or make the only window aside from the 2087 the full frame, or make the only window aside from the
2094 minibuffer the full frame. */ 2088 minibuffer the full frame. */
2095 delta = maxdelta; 2089 delta = maxdelta;
2096 2090 }
2097 if (delta == 0) 2091
2092 if (*sizep + delta < MINSIZE (window))
2093 {
2094 Fdelete_window (window);
2098 return; 2095 return;
2099 } 2096 }
2100 2097
2101 if (!NILP (p->next) && 2098 if (delta == 0)
2102 (*sizefun) (p->next) - delta >= MINSIZE (p->next)) 2099 return;
2100
2101 if (!NILP (p->next)
2102 && (*sizefun) (p->next) - delta >= MINSIZE (p->next))
2103 { 2103 {
2104 (*setsizefun) (p->next, (*sizefun) (p->next) - delta, 0); 2104 (*setsizefun) (p->next, (*sizefun) (p->next) - delta, 0);
2105 (*setsizefun) (window, *sizep + delta, 0); 2105 (*setsizefun) (window, *sizep + delta, 0);
2106 CURBEG (p->next) += delta; 2106 CURBEG (p->next) += delta;
2107 /* This does not change size of p->next, 2107 /* This does not change size of p->next,
2108 but it propagates the new top edge to its children */ 2108 but it propagates the new top edge to its children */
2109 (*setsizefun) (p->next, (*sizefun) (p->next), 0); 2109 (*setsizefun) (p->next, (*sizefun) (p->next), 0);
2110 } 2110 }
2111 else if (!NILP (p->prev) && 2111 else if (!NILP (p->prev)
2112 (*sizefun) (p->prev) - delta >= MINSIZE (p->prev)) 2112 && (*sizefun) (p->prev) - delta >= MINSIZE (p->prev))
2113 { 2113 {
2114 (*setsizefun) (p->prev, (*sizefun) (p->prev) - delta, 0); 2114 (*setsizefun) (p->prev, (*sizefun) (p->prev) - delta, 0);
2115 CURBEG (window) -= delta; 2115 CURBEG (window) -= delta;
2116 (*setsizefun) (window, *sizep + delta, 0); 2116 (*setsizefun) (window, *sizep + delta, 0);
2117 } 2117 }
2711 Fmarker_position (p->mark), w->buffer); 2711 Fmarker_position (p->mark), w->buffer);
2712 2712
2713 /* As documented in Fcurrent_window_configuration, don't 2713 /* As documented in Fcurrent_window_configuration, don't
2714 save the location of point in the buffer which was current 2714 save the location of point in the buffer which was current
2715 when the window configuration was recorded. */ 2715 when the window configuration was recorded. */
2716 if (!EQ (p->buffer, new_current_buffer) && 2716 if (!EQ (p->buffer, new_current_buffer)
2717 XBUFFER (p->buffer) == current_buffer) 2717 && XBUFFER (p->buffer) == current_buffer)
2718 Fgoto_char (w->pointm); 2718 Fgoto_char (w->pointm);
2719 } 2719 }
2720 else if (NILP (w->buffer) || NILP (XBUFFER (w->buffer)->name)) 2720 else if (NILP (w->buffer) || NILP (XBUFFER (w->buffer)->name))
2721 /* Else unless window has a live buffer, get one. */ 2721 /* Else unless window has a live buffer, get one. */
2722 { 2722 {