In Fkill_buffer do replace_buffer_in_windows before Fset_buffer. (Bug#10114)
authorMartin Rudalics <rudalics@gmx.at>
Wed, 23 Nov 2011 09:57:27 +0000 (10:57 +0100)
committerMartin Rudalics <rudalics@gmx.at>
Wed, 23 Nov 2011 09:57:27 +0000 (10:57 +0100)
* buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
making another buffer current.  (Bug#10114)

src/ChangeLog
src/buffer.c

index ade7eae..694478e 100644 (file)
@@ -1,3 +1,8 @@
+2011-11-23  Martin Rudalics  <rudalics@gmx.at>
+
+       * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
+       making another buffer current.  (Bug#10114)
+
 2011-11-23  Glenn Morris  <rgm@gnu.org>
 
        * font.c (font_find_for_lface) [HAVE_NS]: Ignore case.  (Bug#2526)
index a327a16..f8482c3 100644 (file)
@@ -1526,7 +1526,13 @@ with SIGHUP.  */)
       UNGCPRO;
     }
 
-  /* Make this buffer not be current.
+  /* Run replace_buffer_in_windows before making another buffer current
+     since set-window-buffer-start-and-point will refuse to make another
+     buffer current if the selected window does not show the current
+     buffer.  (Bug#10114) */
+  replace_buffer_in_windows (buffer);
+
+     /* Make this buffer not be current.
      In the process, notice if this is the sole visible buffer
      and give up if so.  */
   if (b == current_buffer)
@@ -1566,7 +1572,6 @@ with SIGHUP.  */)
 
   /* These may run Lisp code and into infinite loops (if someone
      insisted on circular lists) so allow quitting here.  */
-  replace_buffer_in_windows (buffer);
   frames_discard_buffer (buffer);
 
   clear_charpos_cache (b);