comparison src/window.c @ 70081:7130f5a10a22

(adjust_window_trailing_edge): Correctly distinguish series vs parallel cases, even when window has no parent.
author Richard M. Stallman <rms@gnu.org>
date Tue, 18 Apr 2006 20:56:31 +0000
parents 12c8842436ef
children d26708f033f8 2d2f6f096f6e 72dea2ff0142
comparison
equal deleted inserted replaced
70080:e7bda2fbb250 70081:7130f5a10a22
4273 if (window_fixed_size_p (XWINDOW (window), horiz_flag, 1)) 4273 if (window_fixed_size_p (XWINDOW (window), horiz_flag, 1))
4274 error ("Window is not resizable"); 4274 error ("Window is not resizable");
4275 4275
4276 while (1) 4276 while (1)
4277 { 4277 {
4278 Lisp_Object first_parallel = Qnil;
4279
4278 p = XWINDOW (window); 4280 p = XWINDOW (window);
4279 parent = p->parent; 4281 parent = p->parent;
4280 4282
4281 /* Make sure there is a following window. */ 4283 if (NILP (XWINDOW (window)->next))
4282 if (NILP (parent)
4283 && (horiz_flag ? 1
4284 : NILP (XWINDOW (window)->next)))
4285 { 4284 {
4286 Fset_window_configuration (old_config); 4285 Fset_window_configuration (old_config);
4287 error ("No other window following this one"); 4286 error ("No other window following this one");
4287 }
4288
4289 /* See if this level has windows in parallel in the specified
4290 direction. If so, set FIRST_PARALLEL to the first one. */
4291 if (horiz_flag)
4292 {
4293 if (! NILP (parent) && !NILP (XWINDOW (parent)->vchild))
4294 first_parallel = XWINDOW (parent)->vchild;
4295 }
4296 else
4297 {
4298 if (! NILP (parent) && !NILP (XWINDOW (parent)->hchild))
4299 first_parallel = XWINDOW (parent)->hchild;
4288 } 4300 }
4289 4301
4290 /* Don't make this window too small. */ 4302 /* Don't make this window too small. */
4291 if (XINT (CURSIZE (window)) + delta 4303 if (XINT (CURSIZE (window)) + delta
4292 < (horiz_flag ? window_min_width : window_min_height)) 4304 < (horiz_flag ? window_min_width : window_min_height))
4302 /* Adjust this window's edge. */ 4314 /* Adjust this window's edge. */
4303 XSETINT (CURSIZE (window), 4315 XSETINT (CURSIZE (window),
4304 XINT (CURSIZE (window)) + delta); 4316 XINT (CURSIZE (window)) + delta);
4305 4317
4306 /* If this window has following siblings in the desired dimension, 4318 /* If this window has following siblings in the desired dimension,
4307 make them smaller. 4319 make them smaller, and exit the loop.
4320
4308 (If we reach the top of the tree and can never do this, 4321 (If we reach the top of the tree and can never do this,
4309 we will fail and report an error, above.) */ 4322 we will fail and report an error, above.) */
4310 if (horiz_flag 4323 if (NILP (first_parallel))
4311 ? !NILP (XWINDOW (parent)->hchild)
4312 : !NILP (XWINDOW (parent)->vchild))
4313 { 4324 {
4314 if (!NILP (XWINDOW (window)->next)) 4325 if (!NILP (XWINDOW (window)->next))
4315 { 4326 {
4316 /* This may happen for the minibuffer. In that case 4327 /* This may happen for the minibuffer. In that case
4317 the window_deletion_count check below does not work. */ 4328 the window_deletion_count check below does not work. */
4329 } 4340 }
4330 } 4341 }
4331 else 4342 else
4332 /* Here we have a chain of parallel siblings, in the other dimension. 4343 /* Here we have a chain of parallel siblings, in the other dimension.
4333 Change the size of the other siblings. */ 4344 Change the size of the other siblings. */
4334 for (child = (horiz_flag 4345 for (child = first_parallel;
4335 ? XWINDOW (parent)->vchild
4336 : XWINDOW (parent)->hchild);
4337 ! NILP (child); 4346 ! NILP (child);
4338 child = XWINDOW (child)->next) 4347 child = XWINDOW (child)->next)
4339 if (! EQ (child, window)) 4348 if (! EQ (child, window))
4340 size_window (child, XINT (CURSIZE (child)) + delta, 4349 size_window (child, XINT (CURSIZE (child)) + delta,
4341 horiz_flag, 0); 4350 horiz_flag, 0);