* lisp/minibuffer.el (completion-fail-discreetly): New var.
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 18 Nov 2010 02:44:44 +0000 (21:44 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 18 Nov 2010 02:44:44 +0000 (21:44 -0500)
(completion--do-completion): Use it.

lisp/ChangeLog
lisp/minibuffer.el

index 99dff70..48eb3c9 100644 (file)
@@ -1,5 +1,8 @@
 2010-11-18  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * minibuffer.el (completion-fail-discreetly): New var.
+       (completion--do-completion): Use it.
+
        * electric.el (electric-pair-pairs): New var.
        (electric-pair-post-self-insert-function): Use it.
        (electric-layout-post-self-insert-function): Don't insert a before
index 0275dc1..78580c8 100644 (file)
@@ -530,6 +530,9 @@ candidates than this number."
 (make-variable-buffer-local 'completion-all-sorted-completions)
 (defvar completion-cycling nil)
 
+(defvar completion-fail-discreetly nil
+  "If non-nil, stay quiet when there  is no match.")
+
 (defun completion--do-completion (&optional try-completion-function)
   "Do the completion and return a summary of what happened.
 M = completion was performed, the text was Modified.
@@ -558,7 +561,9 @@ E = after completion we now have an Exact match.
     (cond
      ((null comp)
       (minibuffer-hide-completions)
-      (ding) (minibuffer-message "No match") (minibuffer--bitset nil nil nil))
+      (unless completion-fail-discreetly
+        (ding) (minibuffer-message "No match"))
+      (minibuffer--bitset nil nil nil))
      ((eq t comp)
       (minibuffer-hide-completions)
       (goto-char (field-end))