[Top][All Lists]

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

Re: [PATCH] (icomplete-vertical-mode): Add support for affixations and,

From: Daniel Mendler
Subject: Re: [PATCH] (icomplete-vertical-mode): Add support for affixations and, annotations
Date: Tue, 1 Jun 2021 14:37:59 +0200

On 6/1/21 2:00 PM, João Távora wrote:
>> * I observed an issue with the last candidate with `icomplete-scroll=t`
>> - The candidate is one line off the minibuffer screen.
> Hmm, I don't see that problem.  Are you sure you're using the version in
> master?  Else you may be seeing a bug that was in
> scratch/icomplete-vertical-mode-improvements (which should now be
> scratched, as the name implies).

Yes, I am using the newest master version. But the issue seems to be
related somehow to my configuration, since I don't see it with emacs -Q.
I have to investigate which setting does this.

>> * Is it possible to disable the index/count indicator? In Vertico I use
>> `vertico-count-format` for that, if nil, the indicator is disabled.
> I normally don't add a knob for things until someone actually requests
> it.  If you're requesting it, then it can be added (and you can too).

I usually take the same stance as you and I also added this only after a
request to Vertico. I can add a small patch making this configurable.

>> * Do you plan to support the `group-function`?
> Maybe, but nothing in Emacs uses it so I can't test.  You can add it
> too, of course. 

There is `read-char-by-name` one can use for testing. Juri added the
`group-function` there.

> I don't understand one thing about that protocol: why
> the extra TRANSFORM argument flag?  Why not just have that function
> return a tuple with the group title and transformed name?

The design of the `group-function` has been extensively discussed. The
flag is used instead of a tuple for performance reasons. The computation
of the transformed candidate string may require string allocations,
which are expensive if performed for every candidate. By using a flag we
only have to transform the displayed candidates. There is the function
`minibuffer--group-by` which takes the *full* sorted candidate list and
groups the candidates. This function invokes the `group-function` with
`TRANSFORM=nil` once for each filtered candidate. UIs like Icomplete and
Vertico are the main beneficiaries from this API design. It is also nice
for default completion of course, but there the optimization does not
play such a big role.


reply via email to

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