From a1a8b28e527a498125ac93f15176be1e706f016b Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Fri, 19 May 2000 20:33:58 +0000 Subject: [PATCH] (Fbury_buffer): Avoid trouble from burying a killed buffer. --- src/buffer.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) 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; } -- 2.39.5