From: Gerd Moellmann Date: Tue, 21 Nov 2000 20:41:11 +0000 (+0000) Subject: (Fkill_buffer): Notice if the buffer to kill is the X-Git-Tag: emacs-pretest-21.0.92~225 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=77270fac616dd9a25743c95c7082489e5a669f35;p=emacs.git (Fkill_buffer): Notice if the buffer to kill is the sole visible buffer when we're currently in the mini-buffer, and give up if so. --- diff --git a/src/ChangeLog b/src/ChangeLog index 2ba12b23655..5e31398d233 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2000-11-21 Gerd Moellmann + + * buffer.c (Fkill_buffer): Notice if the buffer to kill is the + sole visible buffer when we're currently in the mini-buffer, and + give up if so. + 2000-11-21 Jason Rumney * w32select.c (Fw32_set_clipboard_data): Save a copy of what is diff --git a/src/buffer.c b/src/buffer.c index 8c2deeb5bac..99815cb2d7d 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1236,6 +1236,17 @@ with SIGHUP.") return Qnil; } + /* Notice if the buffer to kill is the sole visible buffer + when we're currently in the mini-buffer, and give up if so. */ + XSETBUFFER (tem, current_buffer); + if (EQ (tem, XWINDOW (minibuf_window)->buffer)) + { + tem = Fother_buffer (buf, Qnil, Qnil); + Fset_buffer (tem); + if (EQ (buf, tem)) + return Qnil; + } + /* Now there is no question: we can kill the buffer. */ #ifdef CLASH_DETECTION