Subject: bug#5139: 23.1.50; feature request: completion-buffer-sort-function

From: Drew Adams <[email-masked]>
Date: Tue, 1 Oct 2019 09:53:49 -0700 (PDT)

> > When a *Completions* buffer is generated by minibuffer-completion-help
> > it will sort the possible completions using string-lessp. It would be
> > nice if the sorting order was not hard-coded but could be modified
> > according to context. That's why I want to suggest to replace the
> > call of string-lessp by something like
> >
> >  (funcall completion-buffer-sort-function)
> >
> > so that completion-buffer-sort-function can be bound by the caller
> > to something else according to context.
> 
> I think what the various packages that do completion (ido, helm,
> company, etc) do is replace the entire completion function, which seems
> more flexible.  And making all those respect such a variable I thing
> would be difficult.
> 
> So I'm closing this as a "wontfix".

FWIW, Icicles does not hard-code the sort function,
including not doing so in any particular command.

(So it does not "replace the entire completion
function" with another one that hard-codes a
different sort function.)

It lets user change the sort order on the fly
during completion.  And it lets users define and
control the available sort functions, in general
and per command.

https://www.emacswiki.org/emacs/Icicles_-_Sorting_Candidates