aboutsummaryrefslogtreecommitdiffstats
path: root/src/minibuf.c
diff options
context:
space:
mode:
authorMiles Bader <[email protected]>2007-07-15 02:05:20 +0000
committerMiles Bader <[email protected]>2007-07-15 02:05:20 +0000
commit7eb1e4534e88a32fe5e549e630fdabf3e062be2b (patch)
tree34fc72789f1cfbfeb067cf507f8871c322df300a /src/minibuf.c
parent76d11d2cf9623e9f4c38e8239c4444ffc1fae485 (diff)
parent6f8a87c027ebd6f9cfdac5c0df97d651227bec62 (diff)
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 803-813) - Update from CVS - Merge from emacs--rel--22 * emacs--rel--22 (patch 51-58) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 233-236) - Merge from emacs--devo--0 - Update from CVS Revision: [email protected]/emacs--multi-tty--0--patch-25
Diffstat (limited to 'src/minibuf.c')
-rw-r--r--src/minibuf.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/minibuf.c b/src/minibuf.c
index 698a3478eb..eeed61be86 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -1723,9 +1723,15 @@ PREDICATE limits completion to a subset of COLLECTION.
See `try-completion' and `all-completions' for more details
on completion, COLLECTION, and PREDICATE.
-If REQUIRE-MATCH is non-nil, the user is not allowed to exit unless
- the input is (or completes to) an element of COLLECTION or is null.
- If it is also not t, typing RET does not exit if it does non-null completion.
+REQUIRE-MATCH can take the following values:
+- t means that the user is not allowed to exit unless
+ the input is (or completes to) an element of COLLECTION or is null.
+- nil means that the user can exit with any input.
+- `confirm-only' means that the user can exit with any input, but she will
+ need to confirm her choice if the input is not an element of COLLECTION.
+- anything else behaves like t except that typing RET does not exit if it
+ does non-null completion.
+
If the input is null, `completing-read' returns DEF, or an empty string
if DEF is nil, regardless of the value of REQUIRE-MATCH.
@@ -2236,6 +2242,18 @@ a repetition of this command will exit. */)
goto exit;
}
+ if (EQ (Vminibuffer_completion_confirm, intern ("confirm-only")))
+ { /* The user is permitted to exit with an input that's rejected
+ by test-completion, but at the condition to confirm her choice. */
+ if (EQ (current_kboard->Vlast_command, Vthis_command))
+ goto exit;
+ else
+ {
+ temp_echo_area_glyphs (build_string (" [Confirm]"));
+ return Qnil;
+ }
+ }
+
/* Call do_completion, but ignore errors. */
SET_PT (ZV);
val = internal_condition_case (complete_and_exit_1, Qerror,