* lisp/simple.el (completion-auto-wrap): Rename from completion-wrap-movement.
(next-completion): Use completion-auto-wrap. https://lists.gnu.org/archive/html/emacs-devel/2022-06/msg00139.html
This commit is contained in:
parent
42203acd60
commit
e494222814
3 changed files with 18 additions and 18 deletions
14
etc/NEWS
14
etc/NEWS
|
@ -1076,17 +1076,11 @@ To enable this behavior, customize the user option
|
|||
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
|
||||
|
@ -1096,6 +1090,12 @@ to complete. The value 'visual' is like 'always', but only updates
|
|||
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.
|
||||
|
|
|
@ -9502,10 +9502,10 @@ Go to the window from which completion was requested."
|
|||
(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)
|
||||
|
@ -9549,7 +9549,7 @@ the completions is popped up and down."
|
|||
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)))
|
||||
|
||||
|
@ -9558,7 +9558,7 @@ Also see the `completion-wrap-movement' variable."
|
|||
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)
|
||||
|
@ -9574,7 +9574,7 @@ Also see the `completion-wrap-movement' variable."
|
|||
(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)
|
||||
|
@ -9598,7 +9598,7 @@ Also see the `completion-wrap-movement' variable."
|
|||
(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
|
||||
|
|
|
@ -383,7 +383,7 @@
|
|||
(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")
|
||||
|
@ -397,7 +397,7 @@
|
|||
(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")
|
||||
|
@ -453,11 +453,11 @@
|
|||
(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)))
|
||||
|
|
Loading…
Add table
Reference in a new issue