changeset 98154:b67146e746c0

(set_window_buffer): Always preserve current-buffer.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 12 Sep 2008 03:41:11 +0000
parents 3fc27537d293
children 314662df7c17
files src/ChangeLog src/window.c
diffstat 2 files changed, 7 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Fri Sep 12 03:11:38 2008 +0000
+++ b/src/ChangeLog	Fri Sep 12 03:41:11 2008 +0000
@@ -1,3 +1,7 @@
+2008-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* window.c (set_window_buffer): Always preserve current-buffer.
+
 2008-09-12  Glenn Morris  <rgm@gnu.org>
 
 	* charset.c (init_charset): Warn if etc/charsets not found.  (Bug#909)
--- a/src/window.c	Fri Sep 12 03:11:38 2008 +0000
+++ b/src/window.c	Fri Sep 12 03:41:11 2008 +0000
@@ -3281,14 +3281,6 @@
 
 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 @@
      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);
     }