unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Juri Linkov <juri@linkov.net>
Cc: Daniel Mendler <mail@daniel-mendler.de>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	emacs-devel@gnu.org
Subject: Re: Simplification of `affixation-function`
Date: Thu, 29 Apr 2021 05:15:39 +0300	[thread overview]
Message-ID: <f1a3b7b4-31d2-ca72-8634-d927648b5965@yandex.ru> (raw)
In-Reply-To: <87y2d2sp18.fsf@mail.linkov.net>

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	other threads:[~2021-04-29  2:15 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
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 [this message]

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=f1a3b7b4-31d2-ca72-8634-d927648b5965@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=juri@linkov.net \
    --cc=mail@daniel-mendler.de \
    --cc=monnier@iro.umontreal.ca \
    /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).