From 77270fac616dd9a25743c95c7082489e5a669f35 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Tue, 21 Nov 2000 20:41:11 +0000 Subject: [PATCH] (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. --- src/ChangeLog | 6 ++++++ src/buffer.c | 11 +++++++++++ 2 files changed, 17 insertions(+) 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 -- 2.39.2