From e494222814585cffaafa2c7784a2e4d632b8cd2d Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Tue, 14 Jun 2022 10:04:56 +0300 Subject: [PATCH] * 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 --- etc/NEWS | 14 +++++++------- lisp/simple.el | 14 +++++++------- test/lisp/minibuffer-tests.el | 8 ++++---- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 1b8560a9239..eb4c6956b81 100644 --- a/etc/NEWS +++ b/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. diff --git a/lisp/simple.el b/lisp/simple.el index 05a0855a964..99c951b24b8 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -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 diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el index 56db00a124f..ec93c8f42a5 100644 --- a/test/lisp/minibuffer-tests.el +++ b/test/lisp/minibuffer-tests.el @@ -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))) -- 2.39.2