From: Juri Linkov <juri@linkov.net>
To: Daniel Mendler <mail@daniel-mendler.de>
Cc: emacs-devel@gnu.org
Subject: Re: Simplification of `affixation-function`
Date: Sun, 25 Apr 2021 00:41:31 +0300 [thread overview]
Message-ID: <878s575pis.fsf@mail.linkov.net> (raw)
In-Reply-To: <9ca07e0f-48f9-ba21-068c-694453fc79d8@daniel-mendler.de> (Daniel Mendler's message of "Sat, 24 Apr 2021 23:17:56 +0200")
> 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`.)
I'm not sure if breaking the existing API is worth the trouble.
We could just change the documentation of ‘affixation-function’ to define
only one supported way of using the “completion + prefix + suffix” format
to reduce confusion.
>> 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.
This is just implementation detail, there is no intention to support
more suffixes.
> Or is the idea that the UI can show all these suffixes in some kind of
> table-like view?
Currently I'm trying to use tabulated-list-mode in the completions buffer.
But even in this case there is no need to add more suffixes for more
table columns.
> My proposal is to only allow three-element lists and remove support to
> specify only the suffix.
Supporting only the suffix still is necessary for the ‘annotation-function’.
> 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.
I'd prefer to support additional text using keywords, e.g.
("completion" "prefix" "suffix" :help "Help text")
next prev parent reply other threads:[~2021-04-24 21:41 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-24 17:35 Simplification of `affixation-function` Daniel Mendler
2021-04-24 20:22 ` Juri Linkov
2021-04-24 21:17 ` Daniel Mendler
2021-04-24 21:41 ` Juri Linkov [this message]
2021-04-24 22:01 ` Daniel Mendler
2021-04-24 22:34 ` Stefan Monnier
2021-04-24 22:48 ` Dmitry Gutov
2021-04-24 22:56 ` Daniel Mendler
2021-04-25 17:58 ` Dmitry Gutov
2021-04-25 18:08 ` Daniel Mendler
2021-04-25 22:31 ` Dmitry Gutov
2021-04-27 16:48 ` Juri Linkov
2021-04-27 17:39 ` Daniel Mendler
2021-04-27 18:11 ` Juri Linkov
2021-04-27 18:40 ` Daniel Mendler
2021-04-28 0:20 ` Dmitry Gutov
2021-04-28 19:59 ` Juri Linkov
2021-04-29 2:15 ` Dmitry Gutov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878s575pis.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=emacs-devel@gnu.org \
--cc=mail@daniel-mendler.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).