[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Updating *Completions* as you type

From: Spencer Baugh
Subject: Re: Updating *Completions* as you type
Date: Tue, 17 Oct 2023 22:57:27 +0000 (UTC)

Juri Linkov <juri@linkov.net> writes:
>> On reflection, I think adding a new option for completions-sort is
>> indeed what we should do.  Otherwise, we won't get historical sorting
>> for non-programmed completing-read, which is a pretty common kind of
>> completing-read.  Here's a patch to do that.
>> We can always add display-sort-functions later for buffers and files, if
>> that ends up being desirable.
> Thanks, this is a nice first step that paves the way to later
> additions of display-sort-functions and keys for toggling
> sorting in *Completions*.
>> Also, tangentially, I think probably we should rework
>> minibuffer-complete-history and minibuffer-complete-defaults to be
>> persistent - as in, regular TAB afterwards continues to complete history
>> or defaults.  And there should be some way to reset back to normal.
>> That would be a good complement to this completions-sort change, by
>> maybe giving a way to switch on-demand to alphabetical sorting.  (I've
>> long thought this would be good and useful, but in particular it's
>> relevant for completions-auto-update since that will otherwise nearly
>> immediately reset the displayed completions back to normal.)
> I think we should choose a key to toggle completion type between
> history/default/regular completion.

That works too of course, although it causes some more proliferation of

I'm curious, what is the intended usage of
minibuffer-complete-{history,defaults}?  The fact that they only do a
single completion has made them not very usable for me.

>> Subject: [PATCH] Add a historical option to completions-sort
>> This causes completion to sort based on history.  This is useful for
>> getting, e.g., most-recently-used order from C-x b.
> Actually for 'C-x b' I'd prefer to sort buffers by the order of (buffer-list),
> not by the order buffers occur in the minibuffer history (that I'd like
> to use for everything else).

Reasonable.  I suggest that this should be achieved by adding a
display-sort-function, though.  (And... actually, that
display-sort-function could maybe just be identity, since the
completions are generated from buffer-list so they are in that order

reply via email to

[Prev in Thread] Current Thread [Next in Thread]