aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/window.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/window.c b/src/window.c
index 8d1aed46dff..d3c72570dd1 100644
--- a/src/window.c
+++ b/src/window.c
@@ -5652,12 +5652,17 @@ scroll_command (Lisp_Object window, Lisp_Object n, int direction)
5652 w = XWINDOW (window); 5652 w = XWINDOW (window);
5653 other_window = ! EQ (window, selected_window); 5653 other_window = ! EQ (window, selected_window);
5654 5654
5655 /* If given window's buffer isn't current, make it current for 5655 /* If given window's buffer isn't current, make it current for the
5656 the moment. But don't screw up if window_scroll gets an error. */ 5656 moment. If the window's buffer is the same, but it is not the
5657 selected window, we need to save-excursion to avoid affecting
5658 point in the selected window (which would cause the selected
5659 window to scroll). Don't screw up if window_scroll gets an
5660 error. */
5657 if (other_window || XBUFFER (w->contents) != current_buffer) 5661 if (other_window || XBUFFER (w->contents) != current_buffer)
5658 { 5662 {
5659 record_unwind_protect_excursion (); 5663 record_unwind_protect_excursion ();
5660 Fset_buffer (w->contents); 5664 if (XBUFFER (w->contents) != current_buffer)
5665 Fset_buffer (w->contents);
5661 } 5666 }
5662 5667
5663 if (other_window) 5668 if (other_window)