From: Nick Roberts Date: Thu, 24 Aug 2006 20:40:53 +0000 (+0000) Subject: (Fswitch_to_buffer): Move buffer to front of X-Git-Tag: emacs-pretest-22.0.90~900 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fab45703d34ca5c8c0adea32a1731bc8b73d77db;p=emacs.git (Fswitch_to_buffer): Move buffer to front of buffer-alist if necessary. --- diff --git a/src/buffer.c b/src/buffer.c index 07d0f676aa2..f6c45852b51 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1684,9 +1684,13 @@ the window-buffer correspondences. */) char *err; if (EQ (buffer, Fwindow_buffer (selected_window))) - /* Basically a NOP. Avoid signalling an error if the selected window - is dedicated, or a minibuffer, ... */ - return Fset_buffer (buffer); + { + if (NILP (norecord) && !EQ (buffer, XCDR (XCAR (Vbuffer_alist)))) + record_buffer (buffer); + /* Basically a NOP. Avoid signalling an error if the selected window + is dedicated, or a minibuffer, ... */ + return Fset_buffer (buffer); + } err = no_switch_window (selected_window); if (err) error (err);