changeset 111588:4ed7d6375e3b

* lisp/minibuffer.el (completion-fail-discreetly): New var. (completion--do-completion): Use it.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 17 Nov 2010 21:44:44 -0500
parents f1526b949e0f
children 586a15d21905
files lisp/ChangeLog lisp/minibuffer.el
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Nov 17 21:43:42 2010 -0500
+++ b/lisp/ChangeLog	Wed Nov 17 21:44:44 2010 -0500
@@ -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
--- a/lisp/minibuffer.el	Wed Nov 17 21:43:42 2010 -0500
+++ b/lisp/minibuffer.el	Wed Nov 17 21:44:44 2010 -0500
@@ -530,6 +530,9 @@
 (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 @@
     (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))