Commit a1a8b28e authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

(Fbury_buffer): Avoid trouble from burying a killed buffer.

parent 59a1ce8d
......@@ -1771,18 +1771,20 @@ selected window if it is displayed there.")
buffer = buf1;
}
/* Move buffer to the end of the buffer list. */
{
register Lisp_Object aelt, link;
/* 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);
}
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);
frames_bury_buffer (buffer);
}
return Qnil;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment