From 0dd72b48a8e85a13b715d6f45faa2cdca25229d9 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Fri, 28 Feb 2025 18:59:11 +0100 Subject: [PATCH] (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) --- lisp/completion-preview.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- 2.39.5