From fab45703d34ca5c8c0adea32a1731bc8b73d77db Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Thu, 24 Aug 2006 20:40:53 +0000 Subject: [PATCH] (Fswitch_to_buffer): Move buffer to front of buffer-alist if necessary. --- src/buffer.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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); -- 2.39.2