From: Martin Rudalics Date: Wed, 23 Nov 2011 09:57:27 +0000 (+0100) Subject: In Fkill_buffer do replace_buffer_in_windows before Fset_buffer. (Bug#10114) X-Git-Tag: emacs-pretest-24.0.92~71 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=56e2e794b0b830b2ccb8d43f5651d13f8be176a5;p=emacs.git In Fkill_buffer do replace_buffer_in_windows before Fset_buffer. (Bug#10114) * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before making another buffer current. (Bug#10114) --- diff --git a/src/ChangeLog b/src/ChangeLog index ade7eaec1e0..694478e2d39 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-11-23 Martin Rudalics + + * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before + making another buffer current. (Bug#10114) + 2011-11-23 Glenn Morris * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526) diff --git a/src/buffer.c b/src/buffer.c index a327a1650f1..f8482c351c5 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -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);