all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Daniel Mendler <mail@daniel-mendler.de>
Cc: 68214@debbugs.gnu.org
Subject: bug#68214: Completion sorting customization by category
Date: Thu, 04 Jan 2024 19:21:29 +0200	[thread overview]
Message-ID: <86le95m2ue.fsf@mail.linkov.net> (raw)
In-Reply-To: <8ebc33fb-d01f-4426-a716-69a11f6dfad1@daniel-mendler.de> (Daniel Mendler's message of "Wed, 3 Jan 2024 18:12:06 +0100")

>>> This function could be used to look up the other meta data
>>> functions too, `display-sort-function`, `annotation-function`,
>>> `affixation-function`, `group-function`, etc.
>> 
>> All these meta data functions could be added later to
>> completion-category-overrides after pushing the current patch.

Now the patch is pushed to master.

> Makes sense, the `display-sort-function' is a good start. I suggest to
> at least add the `cycle-sort-function' too. The cycle threshold can be
> customized too.

Looks like the cycle threshold is already supported,
so I'll add the other meta data.

> For later - in some cases one may also want to customize the
> `annotation-' or `affixation-function'. We have a whole package which
> does only that - see Marginalia on GNU ELPA. In contrast to sorting, for
> annotations one has to work a bit harder, since one may not have access
> to locally let-bound candidate-related data, which is only accessible by
> the completion table closure and not globally.

I guess users should be able to customize completion-category-overrides
in such a way that categories could be associated with Marginalia functions.
So users could enable Marginalia for one category, and disable for another.

>> Maybe customization of completion-category-overrides could support
>> a catch-all category `nil` for completions without metadata, like
>> e.g. `nil` can be used in .dir-locals.el as a catch-all for all modes.
>> But I'm not sure how useful this would be.
>
> Okay. I suggest t instead of nil for the catch-all category. This seems
> more aligned with other customization options or Lisp language
> constructs like `cond'.

This could be done as well.





  reply	other threads:[~2024-01-04 17:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-02 17:07 bug#68214: Completion sorting customization by category Juri Linkov
2024-01-03  7:20 ` Daniel Mendler
2024-01-03 16:07   ` Juri Linkov
2024-01-03 17:12     ` Daniel Mendler
2024-01-04 17:21       ` Juri Linkov [this message]
2024-01-05  7:59         ` Juri Linkov
2024-01-05  8:33           ` Daniel Mendler
2024-01-06 17:33             ` Juri Linkov
2024-01-06 17:59               ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-07 18:05                 ` Juri Linkov
2024-01-07 18:37                   ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-09 17:59                     ` Juri Linkov
2024-01-09 18:14                       ` Juri Linkov
2024-01-09 18:31                         ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-10  7:35                           ` Juri Linkov
2024-01-10  8:53                             ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86le95m2ue.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=68214@debbugs.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.