diff options
| author | Juri Linkov | 2022-06-14 10:04:56 +0300 |
|---|---|---|
| committer | Juri Linkov | 2022-06-14 10:04:56 +0300 |
| commit | e494222814585cffaafa2c7784a2e4d632b8cd2d (patch) | |
| tree | 0536f85cac629c5d499a4d4ca0976df982fd7c8c | |
| parent | 42203acd60d03feceafccbd8a63a17744ff36a36 (diff) | |
| download | emacs-e494222814585cffaafa2c7784a2e4d632b8cd2d.tar.gz emacs-e494222814585cffaafa2c7784a2e4d632b8cd2d.zip | |
* 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
| -rw-r--r-- | etc/NEWS | 14 | ||||
| -rw-r--r-- | lisp/simple.el | 14 | ||||
| -rw-r--r-- | test/lisp/minibuffer-tests.el | 8 |
3 files changed, 18 insertions, 18 deletions
| @@ -1076,18 +1076,12 @@ To enable this behavior, customize the user option | |||
| 1076 | the second one will switch to the "*Completions*" buffer. | 1076 | the second one will switch to the "*Completions*" buffer. |
| 1077 | 1077 | ||
| 1078 | --- | 1078 | --- |
| 1079 | *** New user option 'completion-wrap-movement'. | 1079 | *** New user option 'completion-auto-wrap'. |
| 1080 | When non-nil, the commands 'next-completion' and 'previous-completion' | 1080 | When non-nil, the commands 'next-completion' and 'previous-completion' |
| 1081 | automatically wrap around on reaching the beginning or the end of | 1081 | automatically wrap around on reaching the beginning or the end of |
| 1082 | the "*Completions*" buffer. | 1082 | the "*Completions*" buffer. |
| 1083 | 1083 | ||
| 1084 | +++ | 1084 | +++ |
| 1085 | *** New user option 'completions-sort'. | ||
| 1086 | This option controls the sorting of the completion candidates in | ||
| 1087 | the "*Completions*" buffer. Available styles are no sorting, | ||
| 1088 | alphabetical (the default), or a custom sort function. | ||
| 1089 | |||
| 1090 | +++ | ||
| 1091 | *** New values for the 'completion-auto-help' user option. | 1085 | *** New values for the 'completion-auto-help' user option. |
| 1092 | There are two new values to control the way the "*Completions*" buffer | 1086 | There are two new values to control the way the "*Completions*" buffer |
| 1093 | behaves after pressing a 'TAB' if completion is not unique. The value | 1087 | behaves after pressing a 'TAB' if completion is not unique. The value |
| @@ -1097,6 +1091,12 @@ the completions if they are already visible. The default value 't' | |||
| 1097 | always hides the completion buffer after some completion is made. | 1091 | always hides the completion buffer after some completion is made. |
| 1098 | 1092 | ||
| 1099 | +++ | 1093 | +++ |
| 1094 | *** New user option 'completions-sort'. | ||
| 1095 | This option controls the sorting of the completion candidates in | ||
| 1096 | the "*Completions*" buffer. Available styles are no sorting, | ||
| 1097 | alphabetical (the default), or a custom sort function. | ||
| 1098 | |||
| 1099 | +++ | ||
| 1100 | *** New user option 'completions-max-height'. | 1100 | *** New user option 'completions-max-height'. |
| 1101 | This option limits the height of the "*Completions*" buffer. | 1101 | This option limits the height of the "*Completions*" buffer. |
| 1102 | 1102 | ||
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." | |||
| 9502 | (if (get-buffer-window buf) | 9502 | (if (get-buffer-window buf) |
| 9503 | (select-window (get-buffer-window buf)))))) | 9503 | (select-window (get-buffer-window buf)))))) |
| 9504 | 9504 | ||
| 9505 | (defcustom completion-wrap-movement t | 9505 | (defcustom completion-auto-wrap t |
| 9506 | "Non-nil means to wrap around when selecting completion options. | 9506 | "Non-nil means to wrap around when selecting completion options. |
| 9507 | This affects the commands `next-completion' and | 9507 | This affects the commands `next-completion' and `previous-completion'. |
| 9508 | `previous-completion'." | 9508 | When `completion-auto-select' is t, it wraps through the minibuffer." |
| 9509 | :type 'boolean | 9509 | :type 'boolean |
| 9510 | :version "29.1" | 9510 | :version "29.1" |
| 9511 | :group 'completion) | 9511 | :group 'completion) |
| @@ -9549,7 +9549,7 @@ the completions is popped up and down." | |||
| 9549 | With prefix argument N, move back N items (negative N means move | 9549 | With prefix argument N, move back N items (negative N means move |
| 9550 | forward). | 9550 | forward). |
| 9551 | 9551 | ||
| 9552 | Also see the `completion-wrap-movement' variable." | 9552 | Also see the `completion-auto-wrap' variable." |
| 9553 | (interactive "p") | 9553 | (interactive "p") |
| 9554 | (next-completion (- n))) | 9554 | (next-completion (- n))) |
| 9555 | 9555 | ||
| @@ -9558,7 +9558,7 @@ Also see the `completion-wrap-movement' variable." | |||
| 9558 | With prefix argument N, move N items (negative N means move | 9558 | With prefix argument N, move N items (negative N means move |
| 9559 | backward). | 9559 | backward). |
| 9560 | 9560 | ||
| 9561 | Also see the `completion-wrap-movement' variable." | 9561 | Also see the `completion-auto-wrap' variable." |
| 9562 | (interactive "p") | 9562 | (interactive "p") |
| 9563 | (let ((tabcommand (member (this-command-keys) '("\t" [backtab]))) | 9563 | (let ((tabcommand (member (this-command-keys) '("\t" [backtab]))) |
| 9564 | pos) | 9564 | pos) |
| @@ -9574,7 +9574,7 @@ Also see the `completion-wrap-movement' variable." | |||
| 9574 | (goto-char pos) | 9574 | (goto-char pos) |
| 9575 | ;; If at the last completion option, wrap or skip | 9575 | ;; If at the last completion option, wrap or skip |
| 9576 | ;; to the minibuffer, if requested. | 9576 | ;; to the minibuffer, if requested. |
| 9577 | (when completion-wrap-movement | 9577 | (when completion-auto-wrap |
| 9578 | (if (and (eq completion-auto-select t) tabcommand | 9578 | (if (and (eq completion-auto-select t) tabcommand |
| 9579 | (minibufferp completion-reference-buffer)) | 9579 | (minibufferp completion-reference-buffer)) |
| 9580 | (throw 'bound nil) | 9580 | (throw 'bound nil) |
| @@ -9598,7 +9598,7 @@ Also see the `completion-wrap-movement' variable." | |||
| 9598 | (point) 'mouse-face nil (point-min))))) | 9598 | (point) 'mouse-face nil (point-min))))) |
| 9599 | ;; If at the first completion option, wrap or skip | 9599 | ;; If at the first completion option, wrap or skip |
| 9600 | ;; to the minibuffer, if requested. | 9600 | ;; to the minibuffer, if requested. |
| 9601 | (when completion-wrap-movement | 9601 | (when completion-auto-wrap |
| 9602 | (if (and (eq completion-auto-select t) tabcommand | 9602 | (if (and (eq completion-auto-select t) tabcommand |
| 9603 | (minibufferp completion-reference-buffer)) | 9603 | (minibufferp completion-reference-buffer)) |
| 9604 | (progn | 9604 | (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 @@ | |||
| 383 | (should (eq (current-buffer) (get-buffer "*Completions*")))))) | 383 | (should (eq (current-buffer) (get-buffer "*Completions*")))))) |
| 384 | 384 | ||
| 385 | (ert-deftest completion-auto-wrap-test () | 385 | (ert-deftest completion-auto-wrap-test () |
| 386 | (let ((completion-wrap-movement nil)) | 386 | (let ((completion-auto-wrap nil)) |
| 387 | (completing-read-with-minibuffer-setup | 387 | (completing-read-with-minibuffer-setup |
| 388 | '("aa" "ab" "ac") | 388 | '("aa" "ab" "ac") |
| 389 | (insert "a") | 389 | (insert "a") |
| @@ -397,7 +397,7 @@ | |||
| 397 | (should (equal "ac" (get-text-property (point) 'completion--string))) | 397 | (should (equal "ac" (get-text-property (point) 'completion--string))) |
| 398 | (previous-completion 5) | 398 | (previous-completion 5) |
| 399 | (should (equal "aa" (get-text-property (point) 'completion--string))))) | 399 | (should (equal "aa" (get-text-property (point) 'completion--string))))) |
| 400 | (let ((completion-wrap-movement t)) | 400 | (let ((completion-auto-wrap t)) |
| 401 | (completing-read-with-minibuffer-setup | 401 | (completing-read-with-minibuffer-setup |
| 402 | '("aa" "ab" "ac") | 402 | '("aa" "ab" "ac") |
| 403 | (insert "a") | 403 | (insert "a") |
| @@ -453,11 +453,11 @@ | |||
| 453 | (switch-to-completions) | 453 | (switch-to-completions) |
| 454 | (should (equal 'highlight (get-text-property (point) 'mouse-face))) | 454 | (should (equal 'highlight (get-text-property (point) 'mouse-face))) |
| 455 | (should (equal "aa" (get-text-property (point) 'completion--string))) | 455 | (should (equal "aa" (get-text-property (point) 'completion--string))) |
| 456 | (let ((completion-wrap-movement t)) | 456 | (let ((completion-auto-wrap t)) |
| 457 | (next-completion 3)) | 457 | (next-completion 3)) |
| 458 | (should (equal 'highlight (get-text-property (point) 'mouse-face))) | 458 | (should (equal 'highlight (get-text-property (point) 'mouse-face))) |
| 459 | (should (equal "aa" (get-text-property (point) 'completion--string))) | 459 | (should (equal "aa" (get-text-property (point) 'completion--string))) |
| 460 | (let ((completion-wrap-movement nil)) | 460 | (let ((completion-auto-wrap nil)) |
| 461 | (next-completion 3)) | 461 | (next-completion 3)) |
| 462 | (should (equal 'highlight (get-text-property (point) 'mouse-face))) | 462 | (should (equal 'highlight (get-text-property (point) 'mouse-face))) |
| 463 | (should (equal "ac" (get-text-property (point) 'completion--string))) | 463 | (should (equal "ac" (get-text-property (point) 'completion--string))) |