(next-completion): Use completion-auto-wrap.
https://lists.gnu.org/archive/html/emacs-devel/2022-06/msg00139.html
the second one will switch to the "*Completions*" buffer.
---
-*** New user option 'completion-wrap-movement'.
+*** New user option 'completion-auto-wrap'.
When non-nil, the commands 'next-completion' and 'previous-completion'
automatically wrap around on reaching the beginning or the end of
the "*Completions*" buffer.
-+++
-*** New user option 'completions-sort'.
-This option controls the sorting of the completion candidates in
-the "*Completions*" buffer. Available styles are no sorting,
-alphabetical (the default), or a custom sort function.
-
+++
*** New values for the 'completion-auto-help' user option.
There are two new values to control the way the "*Completions*" buffer
the completions if they are already visible. The default value 't'
always hides the completion buffer after some completion is made.
++++
+*** New user option 'completions-sort'.
+This option controls the sorting of the completion candidates in
+the "*Completions*" buffer. Available styles are no sorting,
+alphabetical (the default), or a custom sort function.
+
+++
*** New user option 'completions-max-height'.
This option limits the height of the "*Completions*" buffer.
(if (get-buffer-window buf)
(select-window (get-buffer-window buf))))))
-(defcustom completion-wrap-movement t
+(defcustom completion-auto-wrap t
"Non-nil means to wrap around when selecting completion options.
-This affects the commands `next-completion' and
-`previous-completion'."
+This affects the commands `next-completion' and `previous-completion'.
+When `completion-auto-select' is t, it wraps through the minibuffer."
:type 'boolean
:version "29.1"
:group 'completion)
With prefix argument N, move back N items (negative N means move
forward).
-Also see the `completion-wrap-movement' variable."
+Also see the `completion-auto-wrap' variable."
(interactive "p")
(next-completion (- n)))
With prefix argument N, move N items (negative N means move
backward).
-Also see the `completion-wrap-movement' variable."
+Also see the `completion-auto-wrap' variable."
(interactive "p")
(let ((tabcommand (member (this-command-keys) '("\t" [backtab])))
pos)
(goto-char pos)
;; If at the last completion option, wrap or skip
;; to the minibuffer, if requested.
- (when completion-wrap-movement
+ (when completion-auto-wrap
(if (and (eq completion-auto-select t) tabcommand
(minibufferp completion-reference-buffer))
(throw 'bound nil)
(point) 'mouse-face nil (point-min)))))
;; If at the first completion option, wrap or skip
;; to the minibuffer, if requested.
- (when completion-wrap-movement
+ (when completion-auto-wrap
(if (and (eq completion-auto-select t) tabcommand
(minibufferp completion-reference-buffer))
(progn
(should (eq (current-buffer) (get-buffer "*Completions*"))))))
(ert-deftest completion-auto-wrap-test ()
- (let ((completion-wrap-movement nil))
+ (let ((completion-auto-wrap nil))
(completing-read-with-minibuffer-setup
'("aa" "ab" "ac")
(insert "a")
(should (equal "ac" (get-text-property (point) 'completion--string)))
(previous-completion 5)
(should (equal "aa" (get-text-property (point) 'completion--string)))))
- (let ((completion-wrap-movement t))
+ (let ((completion-auto-wrap t))
(completing-read-with-minibuffer-setup
'("aa" "ab" "ac")
(insert "a")
(switch-to-completions)
(should (equal 'highlight (get-text-property (point) 'mouse-face)))
(should (equal "aa" (get-text-property (point) 'completion--string)))
- (let ((completion-wrap-movement t))
+ (let ((completion-auto-wrap t))
(next-completion 3))
(should (equal 'highlight (get-text-property (point) 'mouse-face)))
(should (equal "aa" (get-text-property (point) 'completion--string)))
- (let ((completion-wrap-movement nil))
+ (let ((completion-auto-wrap nil))
(next-completion 3))
(should (equal 'highlight (get-text-property (point) 'mouse-face)))
(should (equal "ac" (get-text-property (point) 'completion--string)))