summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-09-13 18:25:17 +0000
committerRichard M. Stallman <rms@gnu.org>1996-09-13 18:25:17 +0000
commita93fc4f1323cbd354957943db98a12ae231ec5c2 (patch)
tree079b407cf570194c6d66d040de83359cad5b8046
parentf8cc39a6b7dd9cd70f2f8c720cf8780dfdedc993 (diff)
downloademacs-a93fc4f1323cbd354957943db98a12ae231ec5c2.tar.gz
(read_minibuf): If not in minibuffer window,
cancel the active minibuffer.
-rw-r--r--src/minibuf.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/minibuf.c b/src/minibuf.c
index db6d5f05cff..b9fc7fa5dd6 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -191,9 +191,15 @@ read_minibuf (map, initial, prompt, backup_n, expflag, histvar, histpos)
prompt = build_string ("");
if (!enable_recursive_minibuffers
- && minibuf_level > 0
- && (EQ (selected_window, minibuf_window)))
- error ("Command attempted to use minibuffer while in minibuffer");
+ && minibuf_level > 0)
+ {
+ if (EQ (selected_window, minibuf_window))
+ error ("Command attempted to use minibuffer while in minibuffer");
+ else
+ /* If we're in another window, cancel the minibuffer that's active. */
+ Fthrow (Qexit,
+ build_string ("Command attempted to use minibuffer while in minibuffer"));
+ }
/* Choose the minibuffer window and frame, and take action on them. */