changeset 72503:6ccb18aa8a5d

(Fswitch_to_buffer): Move buffer to front of buffer-alist if necessary.
author Nick Roberts <nickrob@snap.net.nz>
date Thu, 24 Aug 2006 20:40:53 +0000
parents 552742f761d7
children 27c305d70c67
files src/buffer.c
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/buffer.c	Thu Aug 24 20:40:26 2006 +0000
+++ b/src/buffer.c	Thu Aug 24 20:40:53 2006 +0000
@@ -1684,9 +1684,13 @@
   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);