all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#5139: 23.1.50; feature request: completion-buffer-sort-function
@ 2009-12-07  3:21 Roland Winkler
  2019-10-01 14:58 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Roland Winkler @ 2009-12-07  3:21 UTC (permalink / raw)
  To: emacs-pretest-bug

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.

Kind of related:

Such a function could do more than sorting the completions (or being
a sort predicate). It could also help formatting the *Completions*
buffer. Say, a *Completions* buffer can be hard to read when it
contains many entries. If it lists, for example, buffer names, it
could sort the buffer names by mode and put some kind of seperator
between groups of buffers with the same mode. Then this seperator
could be translated into something like an empty line in the
*Completions* buffer.

Roland





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#5139: 23.1.50; feature request: completion-buffer-sort-function
  2009-12-07  3:21 bug#5139: 23.1.50; feature request: completion-buffer-sort-function Roland Winkler
@ 2019-10-01 14:58 ` Lars Ingebrigtsen
  2019-10-01 16:53   ` Drew Adams
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-01 14:58 UTC (permalink / raw)
  To: Roland Winkler; +Cc: 5139

"Roland Winkler" <Roland.Winkler@physik.uni-erlangen.de> writes:

> 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".

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#5139: 23.1.50; feature request: completion-buffer-sort-function
  2019-10-01 14:58 ` Lars Ingebrigtsen
@ 2019-10-01 16:53   ` Drew Adams
  0 siblings, 0 replies; 3+ messages in thread
From: Drew Adams @ 2019-10-01 16:53 UTC (permalink / raw)
  To: Lars Ingebrigtsen, Roland Winkler; +Cc: 5139

> > 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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-01 16:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-07  3:21 bug#5139: 23.1.50; feature request: completion-buffer-sort-function Roland Winkler
2019-10-01 14:58 ` Lars Ingebrigtsen
2019-10-01 16:53   ` Drew Adams

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.