diff options
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/window.c b/src/window.c index 2e2f6427b5f..e2659885f19 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -1969,7 +1969,7 @@ window_loop (type, obj, mini, frames) | |||
| 1969 | GCPRO1 (windows); | 1969 | GCPRO1 (windows); |
| 1970 | best_window = Qnil; | 1970 | best_window = Qnil; |
| 1971 | 1971 | ||
| 1972 | for (; CONSP (windows); windows = CDR (windows)) | 1972 | for (; CONSP (windows); windows = XCDR (windows)) |
| 1973 | { | 1973 | { |
| 1974 | struct window *w; | 1974 | struct window *w; |
| 1975 | 1975 | ||
| @@ -3667,7 +3667,7 @@ temp_output_buffer_show (buf) | |||
| 3667 | #endif | 3667 | #endif |
| 3668 | set_buffer_internal (old); | 3668 | set_buffer_internal (old); |
| 3669 | 3669 | ||
| 3670 | if (!EQ (Vtemp_buffer_show_function, Qnil)) | 3670 | if (!NILP (Vtemp_buffer_show_function)) |
| 3671 | call1 (Vtemp_buffer_show_function, buf); | 3671 | call1 (Vtemp_buffer_show_function, buf); |
| 3672 | else | 3672 | else |
| 3673 | { | 3673 | { |
| @@ -5831,7 +5831,23 @@ the return value is nil. Otherwise the value is t. */) | |||
| 5831 | else | 5831 | else |
| 5832 | { | 5832 | { |
| 5833 | if (XBUFFER (new_current_buffer) == current_buffer) | 5833 | if (XBUFFER (new_current_buffer) == current_buffer) |
| 5834 | old_point = PT; | 5834 | /* The code further down "preserves point" by saving here PT in |
| 5835 | old_point and then setting it later back into PT. When the | ||
| 5836 | current-selected-window and the final-selected-window both show | ||
| 5837 | the current buffer, this suffers from the problem that the | ||
| 5838 | current PT is the window-point of the current-selected-window, | ||
| 5839 | while the final PT is the point of the final-selected-window, so | ||
| 5840 | this copy from one PT to the other would end up moving the | ||
| 5841 | window-point of the final-selected-window to the window-point of | ||
| 5842 | the current-selected-window. So we have to be careful which | ||
| 5843 | point of the current-buffer we copy into old_point. */ | ||
| 5844 | if (EQ (XWINDOW (data->current_window)->buffer, new_current_buffer) | ||
| 5845 | && WINDOWP (selected_window) | ||
| 5846 | && EQ (XWINDOW (selected_window)->buffer, new_current_buffer) | ||
| 5847 | && !EQ (selected_window, data->current_window)) | ||
| 5848 | old_point = XMARKER (XWINDOW (data->current_window)->pointm)->charpos; | ||
| 5849 | else | ||
| 5850 | old_point = PT; | ||
| 5835 | else | 5851 | else |
| 5836 | /* BUF_PT (XBUFFER (new_current_buffer)) gives us the position of | 5852 | /* BUF_PT (XBUFFER (new_current_buffer)) gives us the position of |
| 5837 | point in new_current_buffer as of the last time this buffer was | 5853 | point in new_current_buffer as of the last time this buffer was |