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>

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#77718: closed (31.0.50; completion styles substring and flex
 are broken)
Date: Mon, 28 Apr 2025 18:02:06 +0000
[Message part 1 (text/plain, inline)]
Your message dated Mon, 28 Apr 2025 14:01:18 -0400
with message-id <jwvecxcw4h3.fsf-monnier+emacs <at> gnu.org>
and subject line Re: bug#77718: 31.0.50; completion styles substring and flex are broken
has caused the debbugs.gnu.org bug report #77718,
regarding 31.0.50; completion styles substring and flex are broken
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
77718: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=77718
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Stephen Berman <stephen.berman <at> gmx.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; completion styles substring and flex are broken
Date: Fri, 11 Apr 2025 00:22:01 +0200
0. Start Emacs like this:

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

   or like this:

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

1. Type `C-x d' and at the prompt enter: `/usr/ TAB'.
=> Now the text following the prompt is this: "/usr//" and "/usr/" is
fontified with face file-name-shadow.

2. Type `TAB' again.
=> Now the text following the prompt is this: "//" and the first forward
slash is fontified with face file-name-shadow.

3. Type `TAB' again.
=> Now a *Completions* buffer pops up listing all the directories
directly under root (dev/, etc/, home/ and so on).

This only happens with the substring and flex completion styles; with
any of the other completion styles (basic, partial-completion, emacs22,
initials), or if Emacs is started just with -Q, then after step 1 as
expected a *Completions* buffer pops up listing the directories under
/usr (bin/, include/, lib/ and so on).

The broken behavior with the substring and flex styles is due to the
change in completion-pcm--merge-completions in this commit:

commit 0fbba16387513e7692b46885833e4a9c218251f0
Author:     Spencer Baugh <sbaugh <at> janestreet.com>
Commit:     Stefan Monnier <monnier <at> iro.umontreal.ca>
CommitDate: Tue Apr 8 14:36:30 2025 -0400

  Preserve an explicit * in pcm-try-completion
  [...]
  * lisp/minibuffer.el (completion-pcm--merge-completions): Don't drop
  important wildcards. (bug#74420)


In GNU Emacs 31.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version
 3.24.49, cairo version 1.18.4) of 2025-04-10 built on strobelfs2
Repository revision: c0ea954d0f650227dc518f02a292daeb27cf0c37
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101016
System Description: Linux From Scratch r12.3-20

Configured using:
 'configure -C 'CFLAGS=-Og -g3' PKG_CONFIG_PATH=/opt/qt6/lib/pkgconfig'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG
RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER
WEBP X11 XDBE XIM XINERAMA XINPUT2 XPM XRANDR GTK3 ZLIB


[Message part 3 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Spencer Baugh <sbaugh <at> janestreet.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 77718-done <at> debbugs.gnu.org,
 stephen.berman <at> gmx.net
Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are
 broken
Date: Mon, 28 Apr 2025 14:01:18 -0400
> But actually there's a simpler and better way to do that: just duplicate
> all the $s to $$, then substitute-in-file-name turns all the $$ back to
> $ without expanding environment variables.  So I did that in the
> attached updated patch.

LGTM, pushed to `master`.


        Stefan



This bug report was last modified today.

Previous Next


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