emacs-devel
[Top][All Lists]
Advanced

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

Re: complexity in minibuffer


From: Daniel Mendler
Subject: Re: complexity in minibuffer
Date: Wed, 2 Jun 2021 17:59:33 +0200

On 6/2/21 5:45 PM, João Távora wrote:
>> If you have 10K completions, the time need to compute their rendering
>> becomes very significant, so we want to only compute the rendering for
>> those completion which actually reach the glass.
> 
> Same answer as to Dmitry.  Did you miss the fact from a lot of email ago
> that I'm proposing attaching a function to each completions to be called
> just-in-time?  The only extra cost is the attachment of this function to the
> completion.

Do you prefer attaching the annotation functions to each completion
candidate over passing down the functions or the metadata to the display
functions directly as argument? This sounds like an unnecessary mutation
of the candidates and it is more complicated.

If you ask me, threading the argument down is the better approach. And
as you mentioned there is also the option to use a dynamically bound
variable, in case you want to avoid passing the metadata down explicitly
as an argument. I prefer to use an explicit function argument, over
introducing global variables, but this is clearly a matter of taste.

Daniel



reply via email to

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