shows the completion list buffer on the second attempt to complete.
In other words, if there is nothing to complete, the first @key{TAB}
echoes @samp{Next char not unique}; the second @key{TAB} shows the
-completion list buffer.
+completion list buffer. With the previous values and the default
+@code{t} the completions are hidden when some unique completion is
+executed. If @code{completion-auto-help} is set to @code{always} the
+completion commands are always shown after a completion attempt or
+updated if they are already visible. If the value is @code{visible}
+then completions are not hidden, but updated if they are already
+visible while the current behavior stays the same as default if they
+are not.
@vindex completion-cycle-threshold
If @code{completion-cycle-threshold} is non-@code{nil}, completion
the "*Completions*" buffer. Available styles are no sorting,
alphabetical (the default), or a custom sort function.
+*** New values for the 'completion-auto-select' option.
+
+There are two new values to control the way *Completions* behave after
+a <tab> if completion is not unique. 'always updates or shows
+the *Completions* buffer after any attempt to complete. 'visual is
+like 'always, but only update the completions if they are already
+visible. The default value t always hide the completion buffer after
+some completion is made.
+
** Isearch and Replace
+++
is requested but cannot be done.
If the value is `lazy', the *Completions* buffer is only displayed after
the second failed attempt to complete."
- :type '(choice (const nil) (const t) (const lazy)))
+ :type '(choice (const :tag "Disabled" nil)
+ (const :tag "Enabled legacy" t)
+ (const :tag "After a second attempt" lazy)
+ (const :tag "Visible update" visible)
+ (const :tag "Always update" always)))
(defvar completion-styles-alist
'((emacs21
(completion--cache-all-sorted-completions beg end comps)
(minibuffer-force-complete beg end))
(completed
- ;; We could also decide to refresh the completions,
- ;; if they're displayed (and assuming there are
- ;; completions left).
- (minibuffer-hide-completions)
- (if exact
- ;; If completion did not put point at end of field,
- ;; it's a sign that completion is not finished.
- (completion--done completion
- (if (< comp-pos (length completion))
- 'exact 'unknown))))
+ (cond
+ (exact
+ ;; If completion did not put point at end of field,
+ ;; it's a sign that completion is not finished.
+ (minibuffer-hide-completions)
+ (completion--done completion
+ (if (< comp-pos (length completion))
+ 'exact 'unknown)))
+ ((pcase completion-auto-help
+ ('visible (get-buffer-window "*Completions*" 0))
+ ('always t))
+ (minibuffer-completion-help beg end))
+ (t (minibuffer-hide-completions))))
;; Show the completion table, if requested.
((not exact)
(if (pcase completion-auto-help