GNU bug report logs - #77718
31.0.50; completion styles substring and flex are broken

Previous Next

Package: emacs;

Reported by: Stephen Berman <stephen.berman <at> gmx.net>

Date: Thu, 10 Apr 2025 22:23:02 UTC

Severity: normal

Found in version 31.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Spencer Baugh <sbaugh <at> janestreet.com>, Eli Zaretskii <eliz <at> gnu.org>, 77718 <at> debbugs.gnu.org
Subject: bug#77718: 31.0.50; completion styles substring and flex are broken
Date: Mon, 30 Jun 2025 14:44:49 +0200
[Message part 1 (text/plain, inline)]
On Tue, 24 Jun 2025 16:00:51 -0400 Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:

> BTW, if we want to fix the problem with a user-config, there is one part
> that would make sense to be user-configurable, which is whether
> `substring` completion should try and complete suffixes at all:
> Depending on your habits and typing style, having a suffix inserted
> after point can be a hindrance rather than a help because it can be
> easier for you to type that suffix than to skip over it.
> The "right" way to make this configurable (IMO) would be to have a new
> completion style that's like `substring` but without the insertion of
> common suffixes.
> [ In my ideal UI, completion styles would not be limited to symbols, so
>   you could have `(substring nil)` and `(substring t)` be the two
>   alternatives, where `substring` would be a style that takes an
>   (optional) `inhibit-common-suffixes` arg.  ]

Building on my previous patch, I've implemented a new style (but not
your ideal UI...) called, for want of a better shortish name,
`substring-emacs30'.  You can see the difference between the current
substring style and the new style by hitting TAB twice after each of the
inputs "C-x f //" and "C-x f //us" when you start emacs as follows:

For the current substring style:

emacs -Q --eval "(custom-set-variables '(completion-category-overrides '((file (styles substring)))))"

For the proposed new style:

emacs -Q --eval "(custom-set-variables '(completion-category-overrides '((file (styles substring-emacs30)))))"

I expect you'll consider the implementation an ugly hack, but it does
seem to yield the results I want, and with my limited understanding of
the completion code, I couldn't think of anything better; but no doubt
you or someone else who knows the code well can.  The patch is attached.

Steve Berman

[Message part 2 (text/x-patch, attachment)]

This bug report was last modified 10 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.