From: Eshel Yaron Date: Fri, 28 Feb 2025 17:59:11 +0000 (+0100) Subject: (completion-preview-sort-function): Refine ':type'. X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0dd72b48a8e85a13b715d6f45faa2cdca25229d9;p=emacs.git (completion-preview-sort-function): Refine ':type'. * lisp/completion-preview.el (completion-preview-sort-function): Add some specific sort functions as available choices for this user option. Suggested by Robert Pluim . (cherry picked from commit 0b0bf7c07f2ecaca1e9b25d72139af0dd7e49832) --- diff --git a/lisp/completion-preview.el b/lisp/completion-preview.el index a8ff78d775c..dfa6080beb1 100644 --- a/lisp/completion-preview.el +++ b/lisp/completion-preview.el @@ -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