summaryrefslogtreecommitdiff
path: root/lisp/minibuffer.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2011-04-10 17:31:14 -0400
committerChong Yidong <cyd@stupidchicken.com>2011-04-10 17:31:14 -0400
commit369e974dc086452033227a5d350c357602c6274e (patch)
treed480a3320659ae79e8f361591c5e4e66b40d8f71 /lisp/minibuffer.el
parent8a2cbd723c0b453b70dc1fcefe5b489f58605258 (diff)
downloademacs-369e974dc086452033227a5d350c357602c6274e.tar.gz
Fix bad interaction between icomplete and completion inline help (Bug#5849).
* lisp/minibuffer.el (completion-show-inline-help): New var. (completion--do-completion, minibuffer-complete) (minibuffer-force-complete, minibuffer-complete-word): Inhibit minibuffer messages if completion-show-inline-help is nil. * lisp/icomplete.el (icomplete-mode): Bind completion-show-inline-help to avoid interference from inline help.
Diffstat (limited to 'lisp/minibuffer.el')
-rw-r--r--lisp/minibuffer.el31
1 files changed, 21 insertions, 10 deletions
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 19084aad5d6..d6e11b5a7c5 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -381,6 +381,9 @@ If the current buffer is not a minibuffer, erase its entire contents."
;; is on, the field doesn't cover the entire minibuffer contents.
(delete-region (minibuffer-prompt-end) (point-max)))
+(defvar completion-show-inline-help t
+ "If non-nil, print helpful inline messages during completion.")
+
(defcustom completion-auto-help t
"Non-nil means automatically provide help for invalid completion input.
If the value is t the *Completion* buffer is displayed whenever completion
@@ -568,8 +571,9 @@ E = after completion we now have an Exact match.
(cond
((null comp)
(minibuffer-hide-completions)
- (unless completion-fail-discreetly
- (ding) (minibuffer-message "No match"))
+ (when (and (not completion-fail-discreetly) completion-show-inline-help)
+ (ding)
+ (minibuffer-message "No match"))
(minibuffer--bitset nil nil nil))
((eq t comp)
(minibuffer-hide-completions)
@@ -639,9 +643,10 @@ E = after completion we now have an Exact match.
(minibuffer-hide-completions))
;; Show the completion table, if requested.
((not exact)
- (if (case completion-auto-help
- (lazy (eq this-command last-command))
- (t completion-auto-help))
+ (if (cond ((null completion-show-inline-help) t)
+ ((eq completion-auto-help 'lazy)
+ (eq this-command last-command))
+ (t completion-auto-help))
(minibuffer-completion-help)
(minibuffer-message "Next char not unique")))
;; If the last exact completion and this one were the same, it
@@ -683,9 +688,11 @@ scroll the window of possible completions."
t)
(t (case (completion--do-completion)
(#b000 nil)
- (#b001 (minibuffer-message "Sole completion")
+ (#b001 (if completion-show-inline-help
+ (minibuffer-message "Sole completion"))
t)
- (#b011 (minibuffer-message "Complete, but not unique")
+ (#b011 (if completion-show-inline-help
+ (minibuffer-message "Complete, but not unique"))
t)
(t t)))))
@@ -743,7 +750,9 @@ Repeated uses step through the possible completions."
(end (field-end))
(all (completion-all-sorted-completions)))
(if (not (consp all))
- (minibuffer-message (if all "No more completions" "No completions"))
+ (if completion-show-inline-help
+ (minibuffer-message
+ (if all "No more completions" "No completions")))
(setq completion-cycling t)
(goto-char end)
(insert (car all))
@@ -931,9 +940,11 @@ Return nil if there is no valid completion, else t."
(interactive)
(case (completion--do-completion 'completion--try-word-completion)
(#b000 nil)
- (#b001 (minibuffer-message "Sole completion")
+ (#b001 (if completion-show-inline-help
+ (minibuffer-message "Sole completion"))
t)
- (#b011 (minibuffer-message "Complete, but not unique")
+ (#b011 (if completion-show-inline-help
+ (minibuffer-message "Complete, but not unique"))
t)
(t t)))