From: Gerd Moellmann Date: Fri, 19 May 2000 20:33:58 +0000 (+0000) Subject: (Fbury_buffer): Avoid trouble from burying a killed buffer. X-Git-Tag: emacs-pretest-21.0.90~3895 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a1a8b28e527a498125ac93f15176be1e706f016b;p=emacs.git (Fbury_buffer): Avoid trouble from burying a killed buffer. --- diff --git a/src/buffer.c b/src/buffer.c index 70de1fbc984..6550d6ac342 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -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; }