summaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2006-04-18 20:56:31 +0000
committerRichard M. Stallman <rms@gnu.org>2006-04-18 20:56:31 +0000
commit0e9eab949ad4cef7359acba5035ce5eab42f58a7 (patch)
treef5c859b6ba854b63f8e6c964c0fba2421c0d574b /src/window.c
parent2ee444ad5e7ad217b5a5569679dafe972b58ea84 (diff)
downloademacs-0e9eab949ad4cef7359acba5035ce5eab42f58a7.tar.gz
(adjust_window_trailing_edge): Correctly distinguish
series vs parallel cases, even when window has no parent.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/src/window.c b/src/window.c
index 9b303a05002..72fbc58e32a 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4275,18 +4275,30 @@ adjust_window_trailing_edge (window, delta, horiz_flag)
while (1)
{
+ Lisp_Object first_parallel = Qnil;
+
p = XWINDOW (window);
parent = p->parent;
- /* Make sure there is a following window. */
- if (NILP (parent)
- && (horiz_flag ? 1
- : NILP (XWINDOW (window)->next)))
+ if (NILP (XWINDOW (window)->next))
{
Fset_window_configuration (old_config);
error ("No other window following this one");
}
+ /* See if this level has windows in parallel in the specified
+ direction. If so, set FIRST_PARALLEL to the first one. */
+ if (horiz_flag)
+ {
+ if (! NILP (parent) && !NILP (XWINDOW (parent)->vchild))
+ first_parallel = XWINDOW (parent)->vchild;
+ }
+ else
+ {
+ if (! NILP (parent) && !NILP (XWINDOW (parent)->hchild))
+ first_parallel = XWINDOW (parent)->hchild;
+ }
+
/* Don't make this window too small. */
if (XINT (CURSIZE (window)) + delta
< (horiz_flag ? window_min_width : window_min_height))
@@ -4304,12 +4316,11 @@ adjust_window_trailing_edge (window, delta, horiz_flag)
XINT (CURSIZE (window)) + delta);
/* If this window has following siblings in the desired dimension,
- make them smaller.
+ make them smaller, and exit the loop.
+
(If we reach the top of the tree and can never do this,
we will fail and report an error, above.) */
- if (horiz_flag
- ? !NILP (XWINDOW (parent)->hchild)
- : !NILP (XWINDOW (parent)->vchild))
+ if (NILP (first_parallel))
{
if (!NILP (XWINDOW (window)->next))
{
@@ -4331,9 +4342,7 @@ adjust_window_trailing_edge (window, delta, horiz_flag)
else
/* Here we have a chain of parallel siblings, in the other dimension.
Change the size of the other siblings. */
- for (child = (horiz_flag
- ? XWINDOW (parent)->vchild
- : XWINDOW (parent)->hchild);
+ for (child = first_parallel;
! NILP (child);
child = XWINDOW (child)->next)
if (! EQ (child, window))