[Top][All Lists]

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

Re: Simplification of `affixation-function`

From: Juri Linkov
Subject: Re: Simplification of `affixation-function`
Date: Tue, 27 Apr 2021 19:48:12 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

> You can also note that the third (suffix) element is always an empty string
> in both of these use cases. So affixation-function was really added to be
> able to add a prefix.

affixation-function was an improvement over annotation-function,
but nonetheless it has limitations too.  What would be a better thing is
like Daniel proposed a new meta `group-function`, I'd imagine a similar
meta `format-function` that could receive a candidate and return
a string to insert to the completions buffer.

Then the caller e.g. help--symbol-completion-table could define whether
to append "u", "a" and "c" in parens by using on a candidate something like
(format "%s (%s)" cand (cond ((fboundp (intern cand)) "f")) ...),
or prepend a dimmed letter as a prefix, or to use an icon.

The same `format-function` could be used to remove the group prefix
when `group-function` is in use, instead of providing an additional
argument `transform` for `group-function`.

reply via email to

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