emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/minibuf.c,v


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/src/minibuf.c,v
Date: Sun, 01 Jul 2007 01:57:22 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        07/07/01 01:57:22

Index: minibuf.c
===================================================================
RCS file: /sources/emacs/emacs/src/minibuf.c,v
retrieving revision 1.330
retrieving revision 1.331
diff -u -b -r1.330 -r1.331
--- minibuf.c   8 Jun 2007 20:09:20 -0000       1.330
+++ minibuf.c   1 Jul 2007 01:57:21 -0000       1.331
@@ -1717,9 +1717,15 @@
 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
+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.
- If it is also not t, typing RET does not exit if it does non-null completion.
+- 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.
 
@@ -2230,6 +2236,18 @@
       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,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]