1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-05 22:20:24 -08:00

Make 'completion-preview-sort-function' a defcustom

* lisp/completion-preview.el
(completion-preview-sort-function): Define and document it
as a user option.
* etc/NEWS: Announce.
This commit is contained in:
Eshel Yaron 2025-02-28 12:07:31 +01:00
parent 5447b015a4
commit 8b9194ae03
No known key found for this signature in database
GPG key ID: EF3EE9CA35D78618
2 changed files with 25 additions and 2 deletions

View file

@ -226,8 +226,20 @@ affect the background color, for example with `hl-line-mode'."
(const :tag "Disable" nil))
:version "31.1")
(defvar completion-preview-sort-function #'minibuffer--sort-by-length-alpha
"Sort function to use for choosing a completion candidate to preview.")
(defcustom completion-preview-sort-function #'minibuffer--sort-by-length-alpha
"Sort function to use for choosing a completion candidate to preview.
Completion Preview mode calls the function that this option specifies to
sort completion candidates. The function takes one argument, the list
of candidates, and returns the list sorted.
The default sort function sorts first by length, then alphabetically.
To disable sorting, set this option to `identity'.
If the completion table that produces the candidates already specifies a
sort function, it takes precedence over this option."
:type 'function
:version "31.1")
(defface completion-preview
'((t :inherit shadow))