From da39107c7b70daf7dc0a160936bdb565bbc36918 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 12 Sep 2008 03:41:11 +0000 Subject: [PATCH] (set_window_buffer): Always preserve current-buffer. --- src/ChangeLog | 4 ++++ src/window.c | 18 +++--------------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index bef4d029e93..adcc4851d22 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2008-09-12 Stefan Monnier + + * window.c (set_window_buffer): Always preserve current-buffer. + 2008-09-12 Glenn Morris * charset.c (init_charset): Warn if etc/charsets not found. (Bug#909) diff --git a/src/window.c b/src/window.c index de0d0d01589..f3154849fef 100644 --- a/src/window.c +++ b/src/window.c @@ -3281,14 +3281,6 @@ change_window_heights (window, n) int window_select_count; -Lisp_Object -Fset_window_buffer_unwind (obuf) - Lisp_Object obuf; -{ - Fset_buffer (obuf); - return Qnil; -} - EXFUN (Fset_window_fringes, 4); EXFUN (Fset_window_scroll_bars, 4); @@ -3407,16 +3399,12 @@ set_window_buffer (window, buffer, run_hooks_p, keep_margins_p) I doubt it's worth the trouble. */ windows_or_buffers_changed++; - /* We must select BUFFER for running the window-scroll-functions. - If WINDOW is selected, switch permanently. - Otherwise, switch but go back to the ambient buffer afterward. */ - if (EQ (window, selected_window)) - Fset_buffer (buffer); + /* We must select BUFFER for running the window-scroll-functions. */ /* We can't check ! NILP (Vwindow_scroll_functions) here because that might itself be a local variable. */ - else if (window_initialized) + if (window_initialized) { - record_unwind_protect (Fset_window_buffer_unwind, Fcurrent_buffer ()); + record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); Fset_buffer (buffer); } -- 2.11.4.GIT