diff options
| author | Richard M. Stallman | 2006-04-18 20:56:31 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2006-04-18 20:56:31 +0000 |
| commit | bd99e2429ef404f8894a428994aae78b9316c4b4 (patch) | |
| tree | 826ff270e033b644b42314a7bf21fbfb1275a569 /src | |
| parent | 67cf9997b9f6d585a76e0af4e3d702b898dccd1b (diff) | |
| download | emacs-bd99e2429ef404f8894a428994aae78b9316c4b4.tar.gz emacs-bd99e2429ef404f8894a428994aae78b9316c4b4.zip | |
(adjust_window_trailing_edge): Correctly distinguish
series vs parallel cases, even when window has no parent.
Diffstat (limited to 'src')
| -rw-r--r-- | src/window.c | 31 |
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) | |||
| 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"); |
| 4288 | } | 4287 | } |
| 4289 | 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; | ||
| 4300 | } | ||
| 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)) |
| @@ -4304,12 +4316,11 @@ adjust_window_trailing_edge (window, delta, horiz_flag) | |||
| 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 | { |
| @@ -4331,9 +4342,7 @@ adjust_window_trailing_edge (window, delta, horiz_flag) | |||
| 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)) |