emacs-devel
[Top][All Lists]
Advanced

[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: Fri, 28 May 2021 13:16:22 +0200

On 5/28/21 12:09 PM, João Távora wrote:
> Really?  The names of the function mention Company, because at the time
> company frontend was their only consumer of them, but the point here is
> to make other frontends consume them.  Anyway, as I understood it they
> were only examples.

Well, the point here is that these are not annotations, which are not
meant to be displayed. So what are we talking here about.

>> The name `resolution-function` does not suggest that the function is
>> supposed to return annotations or decorations.
> 
> Ok, change the name.  Name it `decoration-function` or `annotation-function`.

Then I am more happy with the proposal.

>> It can return anything - this is the over-generalization I am talking
>> about.
> 
> I like that it can return arbitrary pieces of information attached to a
> single completion.  That is a generalization, I don't understand the
> "over" problem.
>
>> This is not an extensible design. I would like that the frontend has the
>> ability to show arbitrary fields, not only fields it already knows of.
> 
> That's generally impossible.  How can a frontend know how to display the
> field 'magical-animated-gif-boomerang-video-url' I'm thinking of
> attaching to the completions of my completion backend?  Eventually, very
> fancy frontends will be able to do that, and it's my job to convince
> them that this is a super-important piece of information to show the
> user, but some frontends can't or won't show video for example.

It is not impossible as long as we require the annotations to be
strings. The affixation function also returns strings.

Alternatively we can specify that the function may return other types
which are then up to the interpretation of the UI.

There should be a possibility for the UI to request all annotations and
then it can display the fields it supports.

Did you see my submission of the GNU ELPA Marginalia package? The
package annotates the candidates with multiple annotations which are
currently displayed in columns. But this formatting happens inside
Marginalia. It would be great if Marginalia could instead return an
arbitrary list of annotations which are then formatted by the frontend,
for example in a table. The list of annotation fields is not fixed.

> To restate, now that I have Icomplete mostly fixed for verticality and
> nice scrolling behaviour and also reworked for easy annotation support,
> I think Juri's idea is a fine one (with the cardinality adjustment --
> one field per call).
>From my side the changes in your icomplete-vertical-mode-improvements
branch are fine.

Daniel



reply via email to

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