diff options
| author | Richard M. Stallman | 2002-01-18 03:50:50 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-01-18 03:50:50 +0000 |
| commit | daf516d34f94c460e018770b8cd6bc59153913d5 (patch) | |
| tree | 856726a101bc9dc710cd2a944857d5661396f951 /src/window.c | |
| parent | 33c18c83f13e189c7e5eb03fd17fc09ac19b8395 (diff) | |
| download | emacs-daf516d34f94c460e018770b8cd6bc59153913d5.tar.gz emacs-daf516d34f94c460e018770b8cd6bc59153913d5.zip | |
(enlarge_window): When exceeding size of parent,
directly delete all the siblings instead of trying to resize it.
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 46 |
1 files changed, 30 insertions, 16 deletions
diff --git a/src/window.c b/src/window.c index e3914f8f97a..be2f6330bf4 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -3543,11 +3543,24 @@ enlarge_window (window, delta, widthflag, preserve_before) | |||
| 3543 | register int delta1; | 3543 | register int delta1; |
| 3544 | register int opht = (*sizefun) (parent); | 3544 | register int opht = (*sizefun) (parent); |
| 3545 | 3545 | ||
| 3546 | /* If trying to grow this window to or beyond size of the parent, | ||
| 3547 | make delta1 so big that, on shrinking back down, | ||
| 3548 | all the siblings end up with less than one line and are deleted. */ | ||
| 3549 | if (opht <= XINT (*sizep) + delta) | 3546 | if (opht <= XINT (*sizep) + delta) |
| 3550 | delta1 = opht * opht * 2; | 3547 | { |
| 3548 | /* If trying to grow this window to or beyond size of the parent, | ||
| 3549 | just delete all the sibling windows. */ | ||
| 3550 | Lisp_Object tem, next; | ||
| 3551 | |||
| 3552 | tem = XWINDOW (parent)->vchild; | ||
| 3553 | if (NILP (tem)) | ||
| 3554 | tem = XWINDOW (parent)->hchild; | ||
| 3555 | |||
| 3556 | while (! NILP (tem)) | ||
| 3557 | { | ||
| 3558 | next = XWINDOW (tem)->next; | ||
| 3559 | if (!EQ (tem, window)) | ||
| 3560 | delete_window (tem); | ||
| 3561 | tem = next; | ||
| 3562 | } | ||
| 3563 | } | ||
| 3551 | else | 3564 | else |
| 3552 | { | 3565 | { |
| 3553 | /* Otherwise, make delta1 just right so that if we add | 3566 | /* Otherwise, make delta1 just right so that if we add |
| @@ -3590,19 +3603,20 @@ enlarge_window (window, delta, widthflag, preserve_before) | |||
| 3590 | ++n; | 3603 | ++n; |
| 3591 | 3604 | ||
| 3592 | delta1 = n * delta; | 3605 | delta1 = n * delta; |
| 3593 | } | ||
| 3594 | 3606 | ||
| 3595 | /* Add delta1 lines or columns to this window, and to the parent, | 3607 | /* Add delta1 lines or columns to this window, and to the parent, |
| 3596 | keeping things consistent while not affecting siblings. */ | 3608 | keeping things consistent while not affecting siblings. */ |
| 3597 | XSETINT (CURSIZE (parent), opht + delta1); | 3609 | XSETINT (CURSIZE (parent), opht + delta1); |
| 3598 | (*setsizefun) (window, XINT (*sizep) + delta1, 0); | 3610 | (*setsizefun) (window, XINT (*sizep) + delta1, 0); |
| 3599 | 3611 | ||
| 3600 | /* Squeeze out delta1 lines or columns from our parent, | 3612 | /* Squeeze out delta1 lines or columns from our parent, |
| 3601 | shriking this window and siblings proportionately. | 3613 | shriking this window and siblings proportionately. |
| 3602 | This brings parent back to correct size. | 3614 | This brings parent back to correct size. |
| 3603 | Delta1 was calculated so this makes this window the desired size, | 3615 | Delta1 was calculated so this makes this window the desired size, |
| 3604 | taking it all out of the siblings. */ | 3616 | taking it all out of the siblings. */ |
| 3605 | (*setsizefun) (parent, opht, 0); | 3617 | (*setsizefun) (parent, opht, 0); |
| 3618 | |||
| 3619 | } | ||
| 3606 | } | 3620 | } |
| 3607 | 3621 | ||
| 3608 | XSETFASTINT (p->last_modified, 0); | 3622 | XSETFASTINT (p->last_modified, 0); |