emacs-devel
[Top][All Lists]
Advanced

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

Re: complexity in minibuffer


From: João Távora
Subject: Re: complexity in minibuffer
Date: Wed, 2 Jun 2021 16:37:16 +0100

On Wed, Jun 2, 2021 at 4:29 PM Dmitry Gutov <dgutov@yandex.ru> wrote:
>
> On 02.06.2021 18:20, João Távora wrote:
> > By that time, you have already traversed the completion list many times.
> > What's the problem with having the completions themselves contain
> > all that's needed to render them?
>
> In any of those "many times", did you already know which completions
> will be displayed, and which will not?
>
> Some transformations will be more costly than others (even if the
> current examples are pretty fast), so we shouldn't call them unless we
> know a given completion will be displayed.

You're again misunderstanding my suggestion, and bringing
up the same concern, which I've already answered. Let me
try again. Call the total group of completions A. Invoke the group func
for every c in A, yes.  _Don'_t transform every completion until you know
which ones to display, call this group D.  Instead allocate a transform
function and attach it to each c in A.  Then call this transform for each
c in D.

Currently, one calls group func for every c in A, to get the
group only.  Then one calls it again for c in D to get the group again
(call this invocation X) and finally call it again for c in D to get the
transformation.

My suggestion can also scrap the double invocation X (getting
the group may be expensive, for some backends).

João



reply via email to

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