* lisp/simple.el (completion-auto-select): Extend the docstring.
to pop it down.
@vindex completion-auto-select
-The completions window can be automatically selected. To enable this
-behavior, customize the user option @code{completion-auto-select} to
-@code{t} and pressing @key{TAB} will switch to the completion list
+ The completions window can be automatically selected. To enable
+this behavior, customize the user option @code{completion-auto-select}
+to @code{t} and pressing @key{TAB} will switch to the completion list
buffer when it pops up that buffer. If the value is
-@code{second-tab}, then the first @key{TAB} will pops up the
-completions list buffer and the second one will switch to it.
+@code{second-tab}, then the first @key{TAB} will pop up the
+completions list buffer, and the second one will switch to it.
@vindex completion-cycle-threshold
If @code{completion-cycle-threshold} is non-@code{nil}, completion
** Minibuffer and Completions
++++
*** The "*Completions*" buffer can now be automatically selected.
To enable this behavior, customize the user option
-'completion-auto-select' to t and pressing 'TAB' will switch to the
-"*Completions*" buffer when it pops up that buffer. If the value is
-'second-tab', then the first tab will display "*Completions*" and the
+'completion-auto-select' to t, then pressing 'TAB' will switch to the
+"*Completions*" buffer when it pops up that buffer. If the value is
+'second-tab', then the first tab will display "*Completions*", and the
second one will switch to the "*Completions*" buffer.
*** New user option 'completion-wrap-movement'.
(let ((window minibuffer-scroll-window))
(with-current-buffer (window-buffer window)
(cond
- ;; here this is possible only when second-tab, so jump now.
+ ;; Here this is possible only when second-tab, so jump now.
(completion-auto-select
(switch-to-completions))
- ;; reverse tab
+ ;; Reverse tab
((equal (this-command-keys) [backtab])
(if (pos-visible-in-window-p (point-min) window)
- ;; If beginning is in view, scroll up to the end
+ ;; If beginning is in view, scroll up to the end.
(set-window-point window (point-max))
;; Else scroll down one screen.
(with-selected-window window (scroll-down))))
- ;; normal tab
+ ;; Normal tab
(t
(if (pos-visible-in-window-p (point-max) window)
- ;; If end is in view, scroll up to the end
+ ;; If end is in view, scroll up to the end.
(set-window-start window (point-min) nil)
;; Else scroll down one screen.
(with-selected-window window (scroll-up)))))
:group 'completion)
(defcustom completion-auto-select nil
- "Non-nil means to automatically select the *Completions* buffer."
- :type '(choice (const :tag "Select window" t)
- (const :tag "Disabled" nil)
+ "Non-nil means to automatically select the *Completions* buffer.
+When the value is t, then pressing TAB will switch to the completion list
+buffer when it pops up that buffer. If the value is `second-tab', then the
+first TAB will pop up the completions list buffer, and the second one will
+switch to it."
+ :type '(choice (const :tag "Disabled" nil)
+ (const :tag "Select window on first tab" t)
(const :tag "Select window on second-tab" second-tab))
:version "29.1"
:group 'completion)
(insert (substitute-command-keys
"In this buffer, type \\[choose-completion] to \
select the completion near point.\n\n")))))
- (if (eq completion-auto-select t)
- (switch-to-completions)))
+ (when (eq completion-auto-select t)
+ (switch-to-completions)))
(add-hook 'completion-setup-hook #'completion-setup-function)