unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Daniel Mendler <mail@daniel-mendler.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Lars Ingebrigtsen <larsi@gnus.org>,
	22324@debbugs.gnu.org, Dmitry Gutov <dgutov@yandex.ru>
Subject: bug#22324: 25.0.50; completion-category-defaults style doesn't override completion-styles (gets prepended instead)
Date: Wed, 26 Jan 2022 19:59:49 +0100	[thread overview]
Message-ID: <bc1f89d4-fec9-a178-0e2b-d70c3c8e957e@daniel-mendler.de> (raw)
In-Reply-To: <jwvee4ue8na.fsf-monnier+emacs@gnu.org>

On 1/26/22 18:19, Stefan Monnier wrote:
> No, because `ignore` will return nil and so we'll just keep going to the
> next style.  We need try/all-completion functions for this style to
> return a non-nil value but that is like "no completion".
> 
> I suspect it can't be done quite right without changing `minibuffer.el`,
> but we can probably get close enough to be tolerable with older Emacsen.
> 
> E.g. for the try-completion case, I think we can return (STRING . POINT)
> and for all-completions maybe returning `0` will do the trick.

Okay, right. This makes the proposal a bit less appealing to be honest,
since we end up with a hack, where the result is something like a
non-nil invalid completion result. Hmm. So maybe we shouldn't do this
and fix the problem at the root? Remove the failover mechanism? I am not
fond of introducing a hack to work around the problematic failover design.
> While we're here, let's not forget the other problem with
> `completion-category-defaults` which is when a package puts something
> like `substring` in it because `partial-completion` is not "good
> enough": this can end up taking precedence over the users's
> customization of the default to something like `flex` which is probably
> not what's wanted.

Exactly. This is the reason why I reset `completion-category-defaults`
in my configuration and I also recommend this in the README of the
packages. I should probably describe the problem more explicitly. Often
users copy example configurations from packages without investigating
the implications. Furthermore in the case of completion styles the
implications are often not that obvious. One more reason to remove
complexity if possible...

> I'm not completely sure how to fix that one.  An cheap solution would be
> to allow `completion-category-defaults` to specify a function rather
> than a list of styles, and then this function will return the list of
> styles to use so it can dynamically adapt to the user's chosen default.
> But it's kind of a cop out because that function will need to "guess"
> what is the relationship between the various styles, which is the crux
> of the matter.
> 
> This problem doesn't apply to `completion-category-override` since we
> can consider it to be the user's responsability to take `completion-styles`
> into account when setting `completion-category-override`.

My cheap proposal would be the removal of `completion-category-defaults`
and the removal of the failover mechanism of
`completion-category-overrides`. Then the user can adjust the
`completion-styles` entirely in their configuration. This is maybe not
the most user friendly solution in the first place. But as soon as you
start to tweak the completion styles it makes things simpler and easier
to understand. My opinion in this case is admittedly a bit radical since
I propose that users adjust their completion styles heavily to unlock a
lot of potential (for example look at orderless and the flexible
orderless style dispatchers). But such adjustments may not be for everyone.

Daniel





  reply	other threads:[~2022-01-26 18:59 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-07 20:27 bug#22324: 25.0.50; completion-category-defaults style doesn't override completion-styles (gets prepended instead) Dmitry Gutov
2016-01-08 12:17 ` Eli Zaretskii
2016-01-08 12:21   ` Dmitry Gutov
2016-01-08 12:26     ` Eli Zaretskii
2016-01-08 12:30       ` Dmitry Gutov
2016-01-08 15:31         ` Eli Zaretskii
2021-12-02  9:10         ` Lars Ingebrigtsen
2021-12-02  9:45           ` Eli Zaretskii
2021-12-06  1:16           ` Dmitry Gutov
2021-12-06  2:25             ` Lars Ingebrigtsen
2021-12-07  1:35               ` Dmitry Gutov
2021-12-07 20:28                 ` Lars Ingebrigtsen
2021-12-07 22:46                   ` Dmitry Gutov
2021-12-09  1:09                     ` Lars Ingebrigtsen
2022-01-21 13:46                       ` Lars Ingebrigtsen
2022-01-24  2:03                         ` Dmitry Gutov
2022-01-24  9:46                           ` Lars Ingebrigtsen
2022-01-25  2:27                             ` Dmitry Gutov
2022-01-25 12:19                               ` Lars Ingebrigtsen
2022-01-26  1:43                                 ` Dmitry Gutov
2022-01-26  2:31                                   ` Daniel Mendler
2022-01-26 13:36                                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-26 13:49                                       ` Daniel Mendler
2022-01-26 17:19                                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-26 18:59                                           ` Daniel Mendler [this message]
2022-01-26 22:57                                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-26 23:32                                               ` Daniel Mendler
2022-01-27  6:52                                                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-28  2:35                                             ` Dmitry Gutov
2022-01-28 11:54                                               ` Daniel Mendler
2022-01-28 16:56                                               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-28 22:06                                                 ` Dmitry Gutov
2022-01-28 23:18                                                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-29  1:57                                                     ` Dmitry Gutov
2022-01-28  2:37                                       ` Dmitry Gutov
2022-01-28 16:59                                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-28 21:23                                           ` Dmitry Gutov
2022-01-28  2:39                                     ` 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=bc1f89d4-fec9-a178-0e2b-d70c3c8e957e@daniel-mendler.de \
    --to=mail@daniel-mendler.de \
    --cc=22324@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=larsi@gnus.org \
    --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).