[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Updating *Completions* as you type
|
From: |
Juri Linkov |
|
Subject: |
Re: Updating *Completions* as you type |
|
Date: |
Mon, 20 Nov 2023 19:47:12 +0200 |
|
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) |
> For buffers, for example, sorting by the buffer-list can be done by just
> setting display-sort-function to identity, but we probably shouldn't
> expose that fact to the user. (We could expose a generic "sort by
> defaults" but that would be less efficient.)
It should be fine to use 'identity' as a value when the Customization UI
will show a more meaningful tag like "Unsorted".
> The sorting style might even require the sorting option to actually
> change the completion table's behavior. File name completion could be
> sorted by mtime, for example, by having the completion table include
> mtime as a text property when read-file-name-sort=mtime, and then
> setting display-sort-function to something which reads that property. I
> think that can only work if we have separate sorting options.
Also a separate option might be needed when a completion table
supports a non-standard sorting order such as
'mule--ucs-names-sort-by-code' when 'read-char-by-name-sort'
is customized to 'code'. But the users still should have freedom
to override all metadata: display-sort-function, affixation-function,
group-function, etc.
>> (setopt completion-category-overrides
>> '((buffer (display-sort-function . minibuffer-sort-by-history))
>> (project-file (display-sort-function . minibuffer-sort-by-history))
>>
>> And default values could be specified in completion-category-defaults.
>
> I think the default values would be part of the completion table itself;
> a completion table can just set display-sort-function itself, it doesn't
> need completion-category-defaults to do that.
OTOH, the completion table needs only to return its category in metadata.
Otherwise every completion table of the same category would need to
duplicate display-sort-function in its completing-read.
> Maybe we should decide what things are supposed to be configured by
> category and what things are supposed to be configured by the table
> itself. Because in theory we could allow setting completion-styles and
> completion-cycle-threshold with completion table metadata, and I'm not
> sure why we didn't do it that way - it could even be nice to have a
> completion style which is specific to an individual completion table.
I guess when an individual completion table needs to use metadata
slightly different from other similar cases then it should provide
a different category/subcategory.
- Re: Updating *Completions* as you type, sbaugh, 2023/11/19
- Re: Updating *Completions* as you type, Juri Linkov, 2023/11/20
- Re: Updating *Completions* as you type, Spencer Baugh, 2023/11/20
- Re: Updating *Completions* as you type,
Juri Linkov <=
- Re: Updating *Completions* as you type, Spencer Baugh, 2023/11/20
- Re: Updating *Completions* as you type, Juri Linkov, 2023/11/21
- Re: Updating *Completions* as you type, sbaugh, 2023/11/21
- Re: Updating *Completions* as you type, Juri Linkov, 2023/11/21
- Re: Updating *Completions* as you type, Spencer Baugh, 2023/11/21
- Re: Updating *Completions* as you type, Juri Linkov, 2023/11/22
- Re: Updating *Completions* as you type, Spencer Baugh, 2023/11/22
- Re: Updating *Completions* as you type, Juri Linkov, 2023/11/23
- Re: Updating *Completions* as you type, sbaugh, 2023/11/23
- Re: Updating *Completions* as you type, Juri Linkov, 2023/11/24