From f673df9707d7dfa3d2d7d4c9f5aff6571ba08dbc Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Mon, 18 Mar 2024 16:37:46 +0100 Subject: [PATCH] Simplify 'completion-all-sorted-completions' --- lisp/minibuffer.el | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 5fc4a9254d5..b67ce30e974 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -2000,7 +2000,6 @@ include as `sort-function' in completion metadata." ('alphabetical #'minibuffer-sort-alphabetically) ('historical #'minibuffer-sort-by-history) (_ completions-sort)))) - (group-fun (completion-metadata-get all-md 'group-function)) (full-base (substring string 0 base-size)) (minibuffer-completion-base (funcall (or (alist-get 'adjust-base-function all-md) #'identity) @@ -2014,24 +2013,7 @@ include as `sort-function' in completion metadata." (setq all (delete-dups all)) (setq last (last all)) - (cond - (sort-fun (setq all (funcall sort-fun all))) - ((and completions-group group-fun) - ;; TODO: experiment with re-grouping here. Might be slow - ;; if the group-fun (given by the table and out of our - ;; control) is slow and/or allocates too much. - ) - (t - ;; If the table doesn't stipulate a sorting function or a - ;; group function, sort first by length and - ;; alphabetically. - (setq all (minibuffer--sort-by-length-alpha all)) - ;; Then sort by history position, and put the default, if it - ;; exists, on top. - (when (minibufferp) - (setq all (minibuffer--sort-by-position - (minibuffer--sort-preprocess-history full-base) - all))))) + (when sort-fun (setq all (funcall sort-fun all))) ;; Cache input for `minibuffer-restore-completion-input', ;; unless STRING is an exact and sole completion. -- 2.39.5