emacs-devel
[Top][All Lists]
Advanced

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

Re: Simplification of `affixation-function`


From: Dmitry Gutov
Subject: Re: Simplification of `affixation-function`
Date: Thu, 29 Apr 2021 05:15:39 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

On 28.04.2021 22:59, Juri Linkov wrote:

I took a look at elisp--company-kind and see such code:

                            :annotation-function
                            (lambda (str) (if (fboundp (intern-soft str)) " 
<f>"))
                            :company-kind #'elisp--company-kind

There are still hard-coded letters where "f" stands for "function".

You're looking at the "old" approach to that feature, using annotation-function. I couldn't just remove it here because the default completion UI doesn't know to use :company-kind (elisp--company-kind's definition is below in the same file).

The approach above has worked okay-ish over the years (so it hopefully illustrates that the use of affixation-function in read-char-by-name is not essential), but has the same flaws that I already described, for the purpose of using it seriously to show icons/kinds/types in different commands and completion tables.

Until now it has only been used for Elisp, and only to indicate one specific kind, so it was less of a problem.



reply via email to

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