aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1994-11-28 20:31:00 +0000
committerRichard M. Stallman <[email protected]>1994-11-28 20:31:00 +0000
commite4c97a67e7ef26c39f33c5227e2aba0e07784f3d (patch)
tree6e20eb102f93b8bc050e1b775e0c913d3513ea3a /src
parentc66587feff67603818ea49fe4b7bfafe77a93e89 (diff)
(Fminibuffer_complete_and_exit): Catch errors in do_completion.
(complete_and_exit_1, complete_and_exit_2): New subroutines.
Diffstat (limited to 'src')
-rw-r--r--src/minibuf.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/minibuf.c b/src/minibuf.c
index 7ca45ecad7..b9b7407987 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -1237,6 +1237,26 @@ scroll the window of possible completions.")
return Qt;
}
+
+/* Subroutines of Fminibuffer_complete_and_exit. */
+
+/* This one is called by internal_condition_case to do the real work. */
+
+Lisp_Object
+complete_and_exit_1 ()
+{
+ return make_number (do_completion ());
+}
+
+/* This one is called by internal_condition_case if an error happens.
+ Pretend the current value is an exact match. */
+
+Lisp_Object
+complete_and_exit_2 (ignore)
+ Lisp_Object ignore;
+{
+ return make_number (1);
+}
DEFUN ("minibuffer-complete-and-exit", Fminibuffer_complete_and_exit,
Sminibuffer_complete_and_exit, 0, 0, "",
@@ -1246,6 +1266,7 @@ a repetition of this command will exit.")
()
{
register int i;
+ Lisp_Object val;
/* Allow user to specify null string */
if (BEGV == ZV)
@@ -1254,7 +1275,11 @@ a repetition of this command will exit.")
if (!NILP (test_completion (Fbuffer_string ())))
goto exit;
- i = do_completion ();
+ /* Call do_completion, but ignore errors. */
+ val = internal_condition_case (complete_and_exit_1, Qerror,
+ complete_and_exit_2);
+
+ i = XFASTINT (val);
switch (i)
{
case 1: