]> git.eshelyaron.com Git - emacs.git/commitdiff
(completion-preview-sort-function): Refine ':type'.
authorEshel Yaron <me@eshelyaron.com>
Fri, 28 Feb 2025 17:59:11 +0000 (18:59 +0100)
committerEshel Yaron <me@eshelyaron.com>
Tue, 4 Mar 2025 20:52:20 +0000 (21:52 +0100)
* lisp/completion-preview.el
(completion-preview-sort-function): Add some specific sort
functions as available choices for this user option.

Suggested by Robert Pluim <rpluim@gmail.com>.

(cherry picked from commit 0b0bf7c07f2ecaca1e9b25d72139af0dd7e49832)

lisp/completion-preview.el

index a8ff78d775cd88ca8767b69337fad70fccf260dd..dfa6080beb104c9b03e531c43e446079a8e18c33 100644 (file)
@@ -248,7 +248,13 @@ 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
+  :type '(choice
+          (function-item :tag "Sort alphabetically"
+                         minibuffer-sort-alphabetically)
+          (function-item :tag "First by length, then alphabetically"
+                         minibuffer--sort-by-length-alpha)
+          (function-item :tag "Disable sorting" identity)
+          (function :tag "Custom sort function"))
   :version "31.1")
 
 (defface completion-preview