emacs-devel
[Top][All Lists]
Advanced

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

Re: Simplification of `affixation-function`


From: Daniel Mendler
Subject: Re: Simplification of `affixation-function`
Date: Sat, 24 Apr 2021 23:17:56 +0200

On 4/24/21 10:22 PM, Juri Linkov wrote:
If the logic of specifying the elements is too confusing,
then such simplification is welcome.

Please note that only the documentation could be changed
to remove mentions of the ability to specify only suffix
for `affixation-function`.  But code will remain unchanged
because internally it depends on the predefined order of elements:
“completion + suffix” or “completion + prefix + suffix”.
There is no backward-compatible way to change this order.

I think it is slightly confusing and unnecessarily complicated. But if you want to retain backward compatibility, there is no way back. However since the `affixation-function` has only been introduced recently, there should still be a time window to change the definition? There is no released version of Emacs with `affixation-function` support.

(If it is decided to change the definition it should be feasible to go over all ELPA/MELPA and apply patches to all packages which already make use of the `affixation-function`.)

More than three elements are already supported since e.g. the
total length is calculated as a sum of lengths of all strings:

   (apply #'+ (mapcar #'string-width str))

I see. So all the later elements are suffixes and concatenated? This seems like an unnecessary completion given that the completion-table implementor can already concatenate all the suffixes. Or is the idea that the UI can show all these suffixes in some kind of table-like view?
It seems that there is at least need for better documentation.

My proposal is to only allow three-element lists and remove support to specify only the suffix.

And one could keep the door open by allowing more than three element lists for additional annotations. Let's say you want to specify some additional help/tool-tip text for example.

Daniel



reply via email to

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