changeset 28930:963baceb2414

(frames_bury_buffer): Don't add a buffer to the frame's buffer list that wasn't selected in that frame.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 16 May 2000 11:46:52 +0000
parents 5d906f89034d
children bb9ed79dd3fd
files src/frame.c
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/frame.c	Tue May 16 11:17:39 2000 +0000
+++ b/src/frame.c	Tue May 16 11:46:52 2000 +0000
@@ -1864,9 +1864,13 @@
 
   FOR_EACH_FRAME (tail, frame)
     {
-      XFRAME (frame)->buffer_list
-	= nconc2 (Fdelq (buffer, XFRAME (frame)->buffer_list),
-		  Fcons (buffer, Qnil));
+      struct frame *f = XFRAME (frame);
+      Lisp_Object found;
+      
+      found = Fmemq (buffer, f->buffer_list);
+      if (!NILP (found))
+	f->buffer_list = nconc2 (Fdelq (buffer, f->buffer_list),
+				 Fcons (buffer, Qnil));
     }
 }