diff options
| author | Gerd Moellmann | 2000-11-07 16:39:24 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-11-07 16:39:24 +0000 |
| commit | c4280705666a91a0d0dc6cbca3e2e202657b6c86 (patch) | |
| tree | eeea9a63e2776769732c009c4ec418c5e3644028 /src/window.c | |
| parent | b5de343d74c4cbc9a2d8d82667aa5caeb53da392 (diff) | |
| download | emacs-c4280705666a91a0d0dc6cbca3e2e202657b6c86.tar.gz emacs-c4280705666a91a0d0dc6cbca3e2e202657b6c86.zip | |
(Fset_window_configuration): Don't try to preserve
point in the current buffer, if that buffer is displayed in more
than one window.
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/src/window.c b/src/window.c index 4a4fecae574..5257c1b0cdb 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -4501,7 +4501,6 @@ the return value is nil. Otherwise the value is t.") | |||
| 4501 | { | 4501 | { |
| 4502 | if (XBUFFER (new_current_buffer) == current_buffer) | 4502 | if (XBUFFER (new_current_buffer) == current_buffer) |
| 4503 | old_point = PT; | 4503 | old_point = PT; |
| 4504 | |||
| 4505 | } | 4504 | } |
| 4506 | 4505 | ||
| 4507 | frame = XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame; | 4506 | frame = XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame; |
| @@ -4516,7 +4515,7 @@ the return value is nil. Otherwise the value is t.") | |||
| 4516 | struct window *root_window; | 4515 | struct window *root_window; |
| 4517 | struct window **leaf_windows; | 4516 | struct window **leaf_windows; |
| 4518 | int n_leaf_windows; | 4517 | int n_leaf_windows; |
| 4519 | int k, i; | 4518 | int k, i, n; |
| 4520 | 4519 | ||
| 4521 | /* If the frame has been resized since this window configuration was | 4520 | /* If the frame has been resized since this window configuration was |
| 4522 | made, we change the frame to the size specified in the | 4521 | made, we change the frame to the size specified in the |
| @@ -4723,15 +4722,24 @@ the return value is nil. Otherwise the value is t.") | |||
| 4723 | #endif | 4722 | #endif |
| 4724 | 4723 | ||
| 4725 | /* Now, free glyph matrices in windows that were not reused. */ | 4724 | /* Now, free glyph matrices in windows that were not reused. */ |
| 4726 | for (i = 0; i < n_leaf_windows; ++i) | 4725 | for (i = n = 0; i < n_leaf_windows; ++i) |
| 4727 | if (NILP (leaf_windows[i]->buffer)) | 4726 | { |
| 4728 | { | 4727 | if (NILP (leaf_windows[i]->buffer)) |
| 4729 | /* Assert it's not reused as a combination. */ | 4728 | { |
| 4730 | xassert (NILP (leaf_windows[i]->hchild) | 4729 | /* Assert it's not reused as a combination. */ |
| 4731 | && NILP (leaf_windows[i]->vchild)); | 4730 | xassert (NILP (leaf_windows[i]->hchild) |
| 4732 | free_window_matrices (leaf_windows[i]); | 4731 | && NILP (leaf_windows[i]->vchild)); |
| 4733 | SET_FRAME_GARBAGED (f); | 4732 | free_window_matrices (leaf_windows[i]); |
| 4734 | } | 4733 | SET_FRAME_GARBAGED (f); |
| 4734 | } | ||
| 4735 | else if (EQ (leaf_windows[i]->buffer, new_current_buffer)) | ||
| 4736 | ++n; | ||
| 4737 | } | ||
| 4738 | |||
| 4739 | /* If more than one window shows the new and old current buffer, | ||
| 4740 | don't try to preserve point in that buffer. */ | ||
| 4741 | if (old_point > 0 && n > 1) | ||
| 4742 | old_point = -1; | ||
| 4735 | 4743 | ||
| 4736 | adjust_glyphs (f); | 4744 | adjust_glyphs (f); |
| 4737 | 4745 | ||