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: Stefan Monnier
Subject: Re: [PATCH] (icomplete-vertical-mode): Add support for affixations and, annotations
Date: Mon, 24 May 2021 21:38:29 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> The ideal API for backends to say what they would like to annotation
> completions with:
>
> - would not allow the annotator backend to affect the cardinality or
>   order of completions being annotated.
>
> - would allow the the annotator backend to perform one-time setup and
>   teardown for the whole set of completions.
>
> annotation-function provides the first but not the second,
> affixation-function provides the second but not the first.
>
> I think the second may not be that useful for the use cases we have
> right now, but let's say I'm wrong and it is.

Fine by me.

> In that case, I think we're better giving another optional endpoint to
> the backend to perform this setup teardown.  For example, a function
> of a lambda.

I don't have a strong opinion on whether the "affixotation" function
should take a single completion or a whole list or what.  Here are the
aspects which I think matter, in this respect:

- We're not in the business of preventing people from shooting
  themselves in the foot, so I think it's fine to pass the whole list of
  completion and receive a whole list of annotated completions, even if
  that runs the risk of receiving a list in a different order or with
  different elements: we can document the expected behavior and just not
  worry about the sneaky guys.  Who knows: those sneaky guys may end up
  finding an actually good use for it.

- For performance reasons it should be OK to call the "affixotation"
  function one element (or a small number of elements) at a time, so we
  only do it for those completions which are actually displayed.
  So this function should not presume that it always receives the complete
  lists of completions.  But here again, this seems to be a small matter
  of documentation.


-- Stefan






reply via email to

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