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: Sat, 29 May 2021 10:11:09 +0200

On 5/28/21 8:46 PM, Juri Linkov wrote:
> (funcall resolution/decoration-function "candidate")
>
> (:prefix "prefix" :suffix "suffix" :my-annotation1 "suffix1" :my-annotation2 
> "suffix2" ...)
> 
> 2. A call with nil instead of the string candidate could return
> the metadata of all supported fields, e.g.:
> 
> (funcall resolution/decoration-function nil)
>
> ((:name :prefix
>   :type 'string)
>  (:name :suffix
>   :type 'string)
>  (:name :my-annotation1
>   :type 'number
>   :tags '(:expensive-field :unstable))
>  (:name :my-annotation2
>   :type 'image)
>  (:name :tablist
>   :type 'list))
> 
> 3. A call with an additional field could restrict the output only
> to that field:
> 
> (funcall resolution/decoration-function "candidate" :prefix)
>
> "prefix"

What about adding a descriptor to the `metadata` alist itself for the
field type information? I think we could go with a slightly simpler
definition.

1. Add a `decoration-function` to the metadata. The function takes two
arguments, a candidate string and a list of field symbols. It returns
returns a plist of the requested fields.
2. Add a `decoration-fields` list to the metadata, which describes all
the available decoration fields with the necessary field type
information in a format similar to the one you described above.

Daniel



reply via email to

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