(defvar completion-fail-discreetly nil
"If non-nil, stay quiet when there is no match.")
+(defun completion--message (msg)
+ (if completion-show-inline-help
+ (minibuffer-message msg)))
+
(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.
(cond
((null comp)
(minibuffer-hide-completions)
- (when (and (not completion-fail-discreetly) completion-show-inline-help)
+ (unless completion-fail-discreetly
(ding)
- (minibuffer-message "No match"))
+ (completion--message "No match"))
(minibuffer--bitset nil nil nil))
((eq t comp)
(minibuffer-hide-completions)
(minibuffer-hide-completions))
;; Show the completion table, if requested.
((not exact)
- (if (cond (icomplete-mode t)
- ((null completion-show-inline-help) t)
- ((eq completion-auto-help 'lazy)
- (eq this-command last-command))
- (t completion-auto-help))
+ (if (case completion-auto-help
+ (lazy (eq this-command last-command))
+ (t completion-auto-help))
(minibuffer-completion-help)
- (minibuffer-message "Next char not unique")))
+ (completion--message "Next char not unique")))
;; If the last exact completion and this one were the same, it
- ;; means we've already given a "Next char not unique" message
+ ;; means we've already given a "Complete, but not unique" message
;; and the user's hit TAB again, so now we give him help.
((eq this-command last-command)
(if completion-auto-help (minibuffer-completion-help))))
t)
(t (case (completion--do-completion)
(#b000 nil)
- (#b001 (if completion-show-inline-help
- (minibuffer-message "Sole completion"))
+ (#b001 (completion--message "Sole completion")
t)
- (#b011 (if completion-show-inline-help
- (minibuffer-message "Complete, but not unique"))
+ (#b011 (completion--message "Complete, but not unique")
t)
(t t)))))
(end (field-end))
(all (completion-all-sorted-completions)))
(if (not (consp all))
- (if completion-show-inline-help
- (minibuffer-message
- (if all "No more completions" "No completions")))
+ (completion--message
+ (if all "No more completions" "No completions"))
(setq completion-cycling t)
(goto-char end)
(insert (car all))
(interactive)
(case (completion--do-completion 'completion--try-word-completion)
(#b000 nil)
- (#b001 (if completion-show-inline-help
- (minibuffer-message "Sole completion"))
+ (#b001 (completion--message "Sole completion")
t)
- (#b011 (if completion-show-inline-help
- (minibuffer-message "Complete, but not unique"))
+ (#b011 (completion--message "Complete, but not unique")
t)
(t t)))