changeset 28991:f8bcf3bec2a6

(Fbury_buffer): Avoid trouble from burying a killed buffer.
author Gerd Moellmann <gerd@gnu.org>
date Fri, 19 May 2000 20:33:58 +0000
parents 80e6f0d6eac1
children c547172f003f
files src/buffer.c
diffstat 1 files changed, 14 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/buffer.c	Fri May 19 15:37:41 2000 +0000
+++ b/src/buffer.c	Fri May 19 20:33:58 2000 +0000
@@ -1771,18 +1771,20 @@
       buffer = buf1;
     }
 
-  /* Move buffer to the end of the buffer list.  */
-  {
-    register Lisp_Object aelt, link;
-
-    aelt = Frassq (buffer, Vbuffer_alist);
-    link = Fmemq (aelt, Vbuffer_alist);
-    Vbuffer_alist = Fdelq (aelt, Vbuffer_alist);
-    XCDR (link) = Qnil;
-    Vbuffer_alist = nconc2 (Vbuffer_alist, link);
-  }
-
-  frames_bury_buffer (buffer);
+  /* Move buffer to the end of the buffer list.  Do nothing if the
+     buffer is killed.  */
+  if (!NILP (XBUFFER (buffer)->name))
+    {
+      Lisp_Object aelt, link;
+
+      aelt = Frassq (buffer, Vbuffer_alist);
+      link = Fmemq (aelt, Vbuffer_alist);
+      Vbuffer_alist = Fdelq (aelt, Vbuffer_alist);
+      XCDR (link) = Qnil;
+      Vbuffer_alist = nconc2 (Vbuffer_alist, link);
+
+      frames_bury_buffer (buffer);
+    }
 
   return Qnil;
 }