From: Stefan Monnier Date: Thu, 18 Nov 2010 02:44:44 +0000 (-0500) Subject: * lisp/minibuffer.el (completion-fail-discreetly): New var. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~45^2~205 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b7e270a2c46ee2d7df7f97fff5a16089ea55622b;p=emacs.git * lisp/minibuffer.el (completion-fail-discreetly): New var. (completion--do-completion): Use it. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 99dff70118a..48eb3c9e955 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2010-11-18 Stefan Monnier + * 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 diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 0275dc1923b..78580c86e45 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -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))