GNU bug report logs - #74772
[PATCH] Consistently add wildcards for completion-pcm-leading-wildcard

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> janestreet.com>

Date: Tue, 10 Dec 2024 17:51:01 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#74772: closed ([PATCH] Consistently add wildcards for
 completion-pcm-leading-wildcard)
Date: Thu, 26 Dec 2024 08:45:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 26 Dec 2024 10:44:26 +0200
with message-id <86a5cizvdh.fsf <at> gnu.org>
and subject line Re: bug#74772: [PATCH] Consistently add wildcards for completion-pcm-leading-wildcard
has caused the debbugs.gnu.org bug report #74772,
regarding [PATCH] Consistently add wildcards for completion-pcm-leading-wildcard
to be marked as done.

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


-- 
74772: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74772
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Spencer Baugh <sbaugh <at> janestreet.com>
To: bug-gnu-emacs <at> gnu.org
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: [PATCH] Consistently add wildcards for completion-pcm-leading-wildcard
Date: Tue, 10 Dec 2024 12:48:23 -0500
[Message part 3 (text/plain, inline)]
Tags: patch


completion-pcm--find-all-completions has two different phases:
First we turn the minibuffer text into a regex and matches
completion alternatives against it.  If that finds no matches,
then we strip some text off the completions and minibuffer text
and call ourselves recursively to find completions, then filter
the results with the removed text (converted into a regex).

Because of this, completion-pcm-leading-wildcard had
inconsistent behavior: in the second phase, the filter created
from the removed text would have a leading wildcard.  That
effectively adds wildcards in the middle of the minibuffer text
at the start of each "word".  But the first phrase created a
regex which had no such wildcards.  Thus, the two phases could
get substantially different results.

We fix this by changing completion-pcm-leading-wildcard to
consistently add a leading wildcard for each word.  This was
always my intention.

* lisp/minibuffer.el (completion-pcm--string->pattern): Include
a wildcard after each delimter with
completion-pcm-leading-wildcard.
* lisp/minibuffer.el (completion-pcm-leading-wildcard): Update
docs.
* doc/emacs/mini.texi (Completion Styles): Update docs.

In GNU Emacs 29.2.50 (build 11, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.15.12, Xaw scroll bars) of 2024-12-02 built on
 igm-qws-u22796a
Repository revision: ddde0f4eead134864c7db775c0aeb93f201c35f6
Repository branch: my-emacs-29
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Rocky Linux 8.10 (Green Obsidian)

Configured using:
 'configure --with-x-toolkit=lucid --without-gpm --without-gconf
 --without-selinux --without-imagemagick --with-modules --with-gif=no
 --with-tree-sitter --with-native-compilation=aot
 PKG_CONFIG_PATH=/usr/local/home/garnish/libtree-sitter/0.22.6-1/lib/pkgconfig/'

[0001-Consistently-add-wildcards-for-completion-pcm-leadin.patch (text/patch, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: sbaugh <at> janestreet.com, 74772-done <at> debbugs.gnu.org
Subject: Re: bug#74772: [PATCH] Consistently add wildcards for
 completion-pcm-leading-wildcard
Date: Thu, 26 Dec 2024 10:44:26 +0200
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: Spencer Baugh <sbaugh <at> janestreet.com>,  74772 <at> debbugs.gnu.org
> Date: Sat, 21 Dec 2024 09:20:33 -0500
> 
> > Stefan, is this patch okay with you?  Any comments?
> 
> It's OK with me, yes,

Thanks, installed on master, and closing the bug.


This bug report was last modified 148 days ago.

Previous Next


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