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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Stephen Berman <stephen.berman@HIDDEN>; dated Thu, 10 Apr 2025 22:23:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 77718 <at> debbugs.gnu.org:


Received: (at 77718) by debbugs.gnu.org; 15 Apr 2025 11:17:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 15 07:17:20 2025
Received: from localhost ([127.0.0.1]:50918 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u4eI3-0001ul-LJ
	for submit <at> debbugs.gnu.org; Tue, 15 Apr 2025 07:17:20 -0400
Received: from mail-vk1-xa2c.google.com ([2607:f8b0:4864:20::a2c]:46235)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>)
 id 1u4eI0-0001uU-1a
 for 77718 <at> debbugs.gnu.org; Tue, 15 Apr 2025 07:17:17 -0400
Received: by mail-vk1-xa2c.google.com with SMTP id
 71dfb90a1353d-523ffbe0dbcso5419767e0c.0
 for <77718 <at> debbugs.gnu.org>; Tue, 15 Apr 2025 04:17:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1744715830; x=1745320630; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=QktqLxyydQitrCFKMWc0EeoLzzYxHzWvIsgmxnjpVm0=;
 b=MELblFVThWQCUm1mmTjK9UYo25RXUwmA64KPl6S98l4rtGRRqZs4kuymBE5sQXnyC4
 NTc8Q/YHwS4Udtk2ePiGQJMszl6EFqViOZL/jDNhzQEokZck/Y1J73nidh3E0jQ0Lm7R
 kCiLTghZwxUssaYdpBmfD+HpIlMRwctktTlmsXKBTf50ZHYnZqD0E9QTsWN8W3MjpR2t
 IctPF7ZDLNTTz3MMVGfre51sQCwBh/ZLp7QQAtTEMt+XVypPWbP8GKvUZXzC+yTLKvMR
 FB/A3W4AgTCWrBpC2dd1XXkTMDcR1cyT1s0MHY1+sy/0NQ8j9suZJvcCoI2k7id+34D/
 7lsQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1744715830; x=1745320630;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=QktqLxyydQitrCFKMWc0EeoLzzYxHzWvIsgmxnjpVm0=;
 b=p726uarFWjLv5NCutKAE5piKhC8ihvJcHbzOqDB2nU3QNxCw9skowlggQ3z430bAPK
 GHvRAokHdpA2u6ZBZu7WJSnW2zJSBfpYVnyfXjTiWsjYgWOD7//PaLk4pv4KrOtx4Ezy
 hda2x6uxqsBL6NA/Zk5kjXdrRDuh4L3keKWqwzOrymc7JE0gASEzGIhNtU0sae27lkfJ
 R39LGjjLOpOUiyE7q93BM5F/aCSlBQA8mj34DKqbe0r52gp+BNlvHKfyKs4uYMJQPz9G
 vYXKME4qJzRSJDVUykI7Gr7KHveIFHFo8qv16LhCkOQSRd5dmp9+RS0a/lI2/gyo7PLH
 l1WQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCXzq1Jtg1xAF5jzfyDvzQfDGUbab8XMqBErqVpJOnVBuAB/G7Aq/bnsUQb0+L3nYhB8cLV2Vg==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YzXBZDu65+PHnaXlw+c1cQH0Lqqh4jFQ+7wIbg3SNuowQ10UgWJ
 MGRyJ3AkPzL6q6iCg0F48/LOtiYr69aaKRRwWNJpZ4vIMXv1oUs2+AgC/tKInmmtY/KF1Vm/WQK
 CWh0sUy9xKW/YLC9E1EdC/AUnQak=
X-Gm-Gg: ASbGnctRV4LAIN8w7gLCsQu3GmmT/8uXUoyOCG3eV0s6Cff/ofQ1Uz4z4CY1NkiTfME
 7DNY5tk7a+I/Df7rre+r93GuzVusk3iTanxCjacCMQ6uj4incR+xifHgPzt8atIDXsWfq0gJ+vW
 GJOpPcYiF+Q4wknkw6G8V12A==
X-Google-Smtp-Source: AGHT+IEvDhpvfKNCtB59T86/RauzjJqWghjBHXvwjmJPNltAF4JR0DpCOMbH/ry3kq97+IWhzbqs2vVS90rwSPY75PU=
X-Received: by 2002:a05:6122:d95:b0:520:61ee:c7f9 with SMTP id
 71dfb90a1353d-527c35b020amr9368100e0c.7.1744715830253; Tue, 15 Apr 2025
 04:17:10 -0700 (PDT)
MIME-Version: 1.0
References: <87y0w7ejxy.fsf@HIDDEN> <86semfp3g9.fsf@HIDDEN>
 <ierh62un94f.fsf@HIDDEN> <ier5xjav609.fsf@HIDDEN>
 <jwvlds6crin.fsf-monnier+emacs@HIDDEN> <ierikn6bi5q.fsf@HIDDEN>
 <86a58ihrfg.fsf@HIDDEN>
In-Reply-To: <86a58ihrfg.fsf@HIDDEN>
From: Ship Mints <shipmints@HIDDEN>
Date: Tue, 15 Apr 2025 07:16:58 -0400
X-Gm-Features: ATxdqUE62sVXKdUeAK2k1cqVTdxRdvt8G6C4wGOeAaEhl09PokgSlalywbN8Oro
Message-ID: <CAN+1HbpCkT9aHH1yU_m4ngiNfRJ=cyayp8bv-QRa2AbkXFNFxg@HIDDEN>
Subject: Re: bug#77718: 31.0.50;
 completion styles substring and flex are broken
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000004be0220632cf4f2d"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 77718
Cc: Spencer Baugh <sbaugh@HIDDEN>, stephen.berman@HIDDEN,
 monnier@HIDDEN, 77718 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--0000000000004be0220632cf4f2d
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, Apr 15, 2025 at 2:26=E2=80=AFAM Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: Spencer Baugh <sbaugh@HIDDEN>
> > Cc: 77718 <at> debbugs.gnu.org,  Eli Zaretskii <eliz@HIDDEN>,  Stephen
> Berman
> >   <stephen.berman@HIDDEN>
> > Date: Mon, 14 Apr 2025 16:30:09 -0400
> >
> > +     (;; Ensure we discard text before // by always using sifn in that
> case.
> > +      (unless (string-search "//" orig)
> > +        (complete-with-action action table orig pred)))
>
> AFAIU, this ignores the case of UNC file names, which begin with "//",
> and other complications with file names on Windows.  Emacs on Windows
> reacts differently to "//" than it does on Posix systems, and it does
> so for very good reasons.
>
> Please don't break file-name completion on Windows.  It took us many
> iterations to get it right, and the result is fragile.  Be sure to
> test each change on Windows as well before installing.
>
> For the same reasons, please test thoroughly with remote file names of
> different formats.
>
> Given the fragility of this, I'd tend to suggest to define a new style
> with these changes, and leave alone the existing styles, even if you
> consider them "broken".
>

The POSIX standard allows "pathnames" that start with "//" and Emacs, for
sure, should respect file names that begin with //.

"A pathname that begins with two successive slashes may be interpreted in
an implementation-defined manner, although more than two leading slashes
shall be treated as a single slash."

"A pathname may optionally contain one or more trailing slashes."

"Multiple successive slashes are considered to be the same as one slash."

For mailing list posterity:

https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#ta=
g_03_271:~:text=3Din%20Filename.-,3.273,-Path%20Prefix
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#ta=
g_03_271:~:text=3Din%20their%20execution.-,3.40,-Basename
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#:~=
:text=3DIf%20a%20pathname%20begins%20with%20two%20successive%20%3Cslash%3E%=
20characters%2C%20the%20first%20component%20following%20the%20leading%20%3C=
slash%3E%20characters%20may%20be%20interpreted%20in%20an%20implementation%2=
Ddefined%20manner%2C%20although%20more%20than%20two%20leading%20%3Cslash%3E=
%20characters%20shall%20be%20treated%20as%20a%20single%20%3Cslash%3E%20char=
acter.
https://pubs.opengroup.org/onlinepubs/007904875/basedefs/xbd_chap03.html#ta=
g_03_266:~:text=3DA%20pathname%20may%20optionally%20contain%20one%20or%20mo=
re%20trailing%20slashes.%20Multiple%20successive%20slashes%20are%20consider=
ed%20to%20be%20the%20same%20as%20one%20slash.

-Stephane

--0000000000004be0220632cf4f2d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"fon=
t-family:monospace"><span style=3D"font-family:Arial,Helvetica,sans-serif">=
On Tue, Apr 15, 2025 at 2:26=E2=80=AFAM Eli Zaretskii &lt;<a href=3D"mailto=
:eliz@HIDDEN">eliz@HIDDEN</a>&gt; wrote:</span></div></div><div class=3D"=
gmail_quote gmail_quote_container"><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex">&gt; From: Spencer Baugh &lt;<a href=3D"mailto:sbaugh@janestreet=
.com" target=3D"_blank">sbaugh@HIDDEN</a>&gt;<br>
&gt; Cc: <a href=3D"mailto:77718 <at> debbugs.gnu.org" target=3D"_blank">77718@d=
ebbugs.gnu.org</a>,=C2=A0 Eli Zaretskii &lt;<a href=3D"mailto:eliz@HIDDEN"=
 target=3D"_blank">eliz@HIDDEN</a>&gt;,=C2=A0 Stephen Berman<br>
&gt;=C2=A0 =C2=A0&lt;<a href=3D"mailto:stephen.berman@HIDDEN" target=3D"_b=
lank">stephen.berman@HIDDEN</a>&gt;<br>
&gt; Date: Mon, 14 Apr 2025 16:30:09 -0400<br>
&gt; <br>
&gt; +=C2=A0 =C2=A0 =C2=A0(;; Ensure we discard text before // by always us=
ing sifn in that case.<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 (unless (string-search &quot;//&quot; orig)<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 (complete-with-action action table orig p=
red)))<br>
<br>
AFAIU, this ignores the case of UNC file names, which begin with &quot;//&q=
uot;,<br>
and other complications with file names on Windows.=C2=A0 Emacs on Windows<=
br>
reacts differently to &quot;//&quot; than it does on Posix systems, and it =
does<br>
so for very good reasons.<br>
<br>
Please don&#39;t break file-name completion on Windows.=C2=A0 It took us ma=
ny<br>
iterations to get it right, and the result is fragile.=C2=A0 Be sure to<br>
test each change on Windows as well before installing.<br>
<br>
For the same reasons, please test thoroughly with remote file names of<br>
different formats.<br>
<br>
Given the fragility of this, I&#39;d tend to suggest to define a new style<=
br>
with these changes, and leave alone the existing styles, even if you<br>
consider them &quot;broken&quot;.<br></blockquote><div><br></div><div class=
=3D"gmail_default" style=3D"font-family:monospace">The POSIX standard allow=
s &quot;pathnames&quot; that start with &quot;//&quot; and Emacs, for sure,=
 should respect file names that begin with //.</div><div class=3D"gmail_def=
ault" style=3D"font-family:monospace"><div class=3D"gmail_default"><br></di=
v><div class=3D"gmail_default">&quot;A pathname that begins with two succes=
sive slashes may be interpreted in an implementation-defined manner, althou=
gh more than two leading slashes shall be treated as a single slash.&quot;<=
/div></div><div class=3D"gmail_default" style=3D"font-family:monospace"><br=
></div><div class=3D"gmail_default" style=3D"font-family:monospace">&quot;A=
 pathname may optionally contain one or more trailing slashes.&quot;</div><=
div class=3D"gmail_default" style=3D"font-family:monospace"><br></div><div =
class=3D"gmail_default" style=3D"font-family:monospace">&quot;Multiple succ=
essive slashes are considered to be the same as one slash.&quot;</div><div =
class=3D"gmail_default" style=3D"font-family:monospace"><br></div><div clas=
s=3D"gmail_default" style=3D"font-family:monospace"><div class=3D"gmail_def=
ault"><div class=3D"gmail_default">For mailing list posterity:</div></div><=
/div><div class=3D"gmail_default" style=3D"font-family:monospace"><br></div=
><div class=3D"gmail_default" style=3D"font-family:monospace"><a href=3D"ht=
tps://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_=
03_271:~:text=3Din%20Filename.-,3.273,-Path%20Prefix">https://pubs.opengrou=
p.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_271:~:text=3Din%=
20Filename.-,3.273,-Path%20Prefix</a><br></div><div class=3D"gmail_default"=
 style=3D"font-family:monospace"><a href=3D"https://pubs.opengroup.org/onli=
nepubs/9699919799/basedefs/V1_chap03.html#tag_03_271:~:text=3Din%20their%20=
execution.-,3.40,-Basename">https://pubs.opengroup.org/onlinepubs/969991979=
9/basedefs/V1_chap03.html#tag_03_271:~:text=3Din%20their%20execution.-,3.40=
,-Basename</a><br></div><div class=3D"gmail_default" style=3D"font-family:m=
onospace"><a href=3D"https://pubs.opengroup.org/onlinepubs/9699919799/based=
efs/V1_chap04.html#:~:text=3DIf%20a%20pathname%20begins%20with%20two%20succ=
essive%20%3Cslash%3E%20characters%2C%20the%20first%20component%20following%=
20the%20leading%20%3Cslash%3E%20characters%20may%20be%20interpreted%20in%20=
an%20implementation%2Ddefined%20manner%2C%20although%20more%20than%20two%20=
leading%20%3Cslash%3E%20characters%20shall%20be%20treated%20as%20a%20single=
%20%3Cslash%3E%20character.">https://pubs.opengroup.org/onlinepubs/96999197=
99/basedefs/V1_chap04.html#:~:text=3DIf%20a%20pathname%20begins%20with%20tw=
o%20successive%20%3Cslash%3E%20characters%2C%20the%20first%20component%20fo=
llowing%20the%20leading%20%3Cslash%3E%20characters%20may%20be%20interpreted=
%20in%20an%20implementation%2Ddefined%20manner%2C%20although%20more%20than%=
20two%20leading%20%3Cslash%3E%20characters%20shall%20be%20treated%20as%20a%=
20single%20%3Cslash%3E%20character.</a><br></div><div class=3D"gmail_defaul=
t" style=3D"font-family:monospace"><a href=3D"https://pubs.opengroup.org/on=
linepubs/007904875/basedefs/xbd_chap03.html#tag_03_266:~:text=3DA%20pathnam=
e%20may%20optionally%20contain%20one%20or%20more%20trailing%20slashes.%20Mu=
ltiple%20successive%20slashes%20are%20considered%20to%20be%20the%20same%20a=
s%20one%20slash.">https://pubs.opengroup.org/onlinepubs/007904875/basedefs/=
xbd_chap03.html#tag_03_266:~:text=3DA%20pathname%20may%20optionally%20conta=
in%20one%20or%20more%20trailing%20slashes.%20Multiple%20successive%20slashe=
s%20are%20considered%20to%20be%20the%20same%20as%20one%20slash.</a><br></di=
v><div class=3D"gmail_default" style=3D"font-family:monospace"><br></div><d=
iv class=3D"gmail_default" style=3D"font-family:monospace">-Stephane</div><=
/div></div>

--0000000000004be0220632cf4f2d--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77718; Package emacs. Full text available.

Message received at 77718 <at> debbugs.gnu.org:


Received: (at 77718) by debbugs.gnu.org; 15 Apr 2025 08:22:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 15 04:22:28 2025
Received: from localhost ([127.0.0.1]:50467 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u4bYq-00076V-5G
	for submit <at> debbugs.gnu.org; Tue, 15 Apr 2025 04:22:28 -0400
Received: from mout.gmx.net ([212.227.17.20]:40819)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <stephen.berman@HIDDEN>)
 id 1u4bYm-00076D-Fr
 for 77718 <at> debbugs.gnu.org; Tue, 15 Apr 2025 04:22:26 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net;
 s=s31663417; t=1744705337; x=1745310137; i=stephen.berman@HIDDEN;
 bh=AIg4QSqgHd86vPxGLPUi3gjkx90vQK559n603F+O2Eg=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date:
 Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding:
 content-type:date:from:message-id:mime-version:reply-to:subject:
 to;
 b=c7tNQZ2GINn7zoPsk4lpbRV1ut7BfqM6GpFqrgOjQIqJjDmuR1015Uxjo6YLXwM8
 X79TSevtJ1L5F6b6/jAEDAxwPI7h8HI6jhv9eGryyHCU17vSEJj3KwmFsRV+lhLZM
 Ub9eQyGs+sRpOT7ey+T6MBE70DtoZM2KD4uQF9RpJtH+aQ7RN2k4IUrJr5GFBEzBr
 p3uJ3rt5v/FIT2FjfSuCf7IRjNXUuq4YIHNDdaRl18VqOv6bIywaL1Mhjshq8Dr49
 2yidmKSlYp/9qjAG/DTJmW9aT6nM5K6DVYTvqRO2ouquXx7s6eySE104uhVe0TyHC
 /yykP2wJx14+E5DbrA==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from strobelfs2 ([94.134.95.70]) by mail.gmx.net (mrgmx104
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N8obG-1szB1D2etK-016HTW; Tue, 15
 Apr 2025 10:22:17 +0200
From: Stephen Berman <stephen.berman@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are
 broken
In-Reply-To: <ierikn6bi5q.fsf@HIDDEN>
References: <87y0w7ejxy.fsf@HIDDEN> <86semfp3g9.fsf@HIDDEN>
 <ierh62un94f.fsf@HIDDEN> <ier5xjav609.fsf@HIDDEN>
 <jwvlds6crin.fsf-monnier+emacs@HIDDEN>
 <ierikn6bi5q.fsf@HIDDEN>
Date: Tue, 15 Apr 2025 10:22:15 +0200
Message-ID: <87a58hal6w.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:21YslgaZfUCYz0FtfqJkVKBWYYCDA9O0SFmYPPyRR3BpGpD0My3
 IbCw3mXykaSjgWsm6noy6mz1sUxlkomyVHp8Zd8ab+YunPVkLtE1CnTJKXdc7BCZT70k1t4
 Yfe0H0htGVSxCVm9U2cGypkGsSq7M52f0mYBoxr1+5WCwa+rq2sHp8NdlCTmpTnNgRgRy0w
 LzTKLf/4ZwIg8o/HgZ0fw==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:TAJrj4/+fCU=;OeyqPfdw/esiTJP5koFtFLe5dT1
 LHNlAS0Z0Xa5BBE7r7vhw5w8+cMRKw8+M1p5WY89Ebsc9FiBAGtlmtxi4Ybj3zAlJtXjJpCQX
 lY2AYZbd2ZYPX/CsN/DSZFkHG8pQ1ghcOLqIvz1FJpDgseL/B7N7b5kBHK9fOFH/WxJJZ68D3
 LScyADwajKvCz+0MlWJYtci8+Lnra8/3gBWbZYgS2ZnwwBgBCbPy+jtlI+2F6KhNylSYweSr+
 ByAJV4IvXzIFaQ2uHCpZyVwdSvM+wTpSJ99jQv6xnz/q7bAU69T2agBRf4JNHmh3FTO/tc2ic
 Tfuz2Rt90cFq6Qkzw3/bBqCG/mhrZHI6QHXoPBFPP8auUgikpMtdj+l4czL3jQVG9fi4iXv2Z
 YBet36cSD99z93aJ9w6OHIF8KIEyE8qoS2Iz+lNXEE4gZ/0Wzhmish2+Mhw8STPMxYwLao4vz
 amFqfxyEp/wtymdhiGNE0EsS9EyV3+tnlEhkr8n+yVXDdbUmP1WCHOMe+lWkZLzWnm0WdYBK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bugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On Mon, 14 Apr 2025 16:30:09 -0400 Spencer Baugh <sbaugh@HIDDEN> wrote:

> Stefan Monnier <monnier@HIDDEN> writes:
>
>>> Stefan, a related question: do you think it would be reasonable to split
>>> completion-table-with-quoting into two functions, separating the
>>> substitute-in-file-name and comint-quote-filename cases?  It seems to me
>>> that the comint-quote-filename case is way simpler than the
>>> substitute-in-file-name case, and it would be a lot easier to understand
>>> if the two cases were done separately, without the abstraction of
>>> requote and unquote functions.  I can do that if that seems reasonable.
>>> It would make fixing this issue a lot easier.
>>
>> It's worth a try.  The system we have is the best I could come up with
>> back then but is hideous, so I'm interested in a simpler solution.
>
> OK, here is a rework of just the substitute-in-file-name side.  This
> fixes this bug (by making completion continue to work when point is at
> /usr/|/), and fixes another FIXME in a test (partial completion now
> preserves environment variables!).  And I don't think it loses anything
> important, but I may be missing something.
>
> (completion--sifn-requote can now be deleted and there are probably
> other cleanups possible after this patch, but I didn't do them here to
> keep the patch smaller.  Also, rfn-eshadow needs to be updated, but
> that's just a visual issue.)

Thanks, I applied your patch and rebuilt emacs, and now completion with
the substring style works, but it's still different from the behavior
before you previous change, as your comments above seem to acknowledge:
now when I enter "/us" and hit TAB, it completes to "/usr/" and when I
hit TAB again it becomes "/usr//" with point on (i.e. just before) the
last slash and "/usr/" displayed with the file-name-shadow face.
Hitting TAB again pops up a *Completions* buffer with the correct
completions (immediate subdirectories of /usr) and typing part of a
candidate in the minibuffer correctly expands the file name.  This
behavior obtains with any directory whose immediate children are all
directories; if at least one child is a non-directory file, the
*Completions* buffer up on hitting the TAB the second time (and the part
of the file name up to the final slash has the default face); so here
the completion works also visually as before.  So your patch only
partially fixes the regression.

Steve Berman




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77718; Package emacs. Full text available.

Message received at 77718 <at> debbugs.gnu.org:


Received: (at 77718) by debbugs.gnu.org; 15 Apr 2025 06:25:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 15 02:25:52 2025
Received: from localhost ([127.0.0.1]:50210 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u4Zjz-0006qp-OF
	for submit <at> debbugs.gnu.org; Tue, 15 Apr 2025 02:25:52 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:60386)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1u4Zjx-0006qd-VM
 for 77718 <at> debbugs.gnu.org; Tue, 15 Apr 2025 02:25:50 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1u4Zjr-00046R-AQ; Tue, 15 Apr 2025 02:25:43 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=JxWHBPSUROWuyT5AtBA6sddYMc7CNqXNAy2ycosiE40=; b=BKKHKrIX0GOW
 HMRBc0e2lmegXcw8ZG7DTIp0Esp7pQXVtnOY0I7YHccQAWYwonHlIo7nsnB9d4zcJ66f4QqsrU5Y6
 UM+1lYZ5tLKedCIY2M9aXwjWaKd1PWxgrEl/IAv3xxpQK1D/dlC8EPbVf5gVvqPAssBZaQMDaRGVB
 B+ozqPB+/PPhEq/GJKtEuIUffO0ecJHE6P4yMNWkQACEfHizhNBUmh0eyCui47PMEFjHTKUMBJm8l
 ZkwpPjDQLwVXsXHit6PFaZyQrls7y+hMWyn7xRtHNSwrOR7PzZGEKWjlAmXgz9InzvWEud3x0yBnn
 tH1fB6aaxm7UCluSALbgNg==;
Date: Tue, 15 Apr 2025 09:25:39 +0300
Message-Id: <86a58ihrfg.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
In-Reply-To: <ierikn6bi5q.fsf@HIDDEN> (message from Spencer Baugh on
 Mon, 14 Apr 2025 16:30:09 -0400)
Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are
 broken
References: <87y0w7ejxy.fsf@HIDDEN> <86semfp3g9.fsf@HIDDEN>
 <ierh62un94f.fsf@HIDDEN> <ier5xjav609.fsf@HIDDEN>
 <jwvlds6crin.fsf-monnier+emacs@HIDDEN> <ierikn6bi5q.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77718
Cc: 77718 <at> debbugs.gnu.org, stephen.berman@HIDDEN, monnier@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Spencer Baugh <sbaugh@HIDDEN>
> Cc: 77718 <at> debbugs.gnu.org,  Eli Zaretskii <eliz@HIDDEN>,  Stephen Berman
>   <stephen.berman@HIDDEN>
> Date: Mon, 14 Apr 2025 16:30:09 -0400
> 
> +     (;; Ensure we discard text before // by always using sifn in that case.
> +      (unless (string-search "//" orig)
> +        (complete-with-action action table orig pred)))

AFAIU, this ignores the case of UNC file names, which begin with "//",
and other complications with file names on Windows.  Emacs on Windows
reacts differently to "//" than it does on Posix systems, and it does
so for very good reasons.

Please don't break file-name completion on Windows.  It took us many
iterations to get it right, and the result is fragile.  Be sure to
test each change on Windows as well before installing.

For the same reasons, please test thoroughly with remote file names of
different formats.

Given the fragility of this, I'd tend to suggest to define a new style
with these changes, and leave alone the existing styles, even if you
consider them "broken".




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77718; Package emacs. Full text available.

Message received at 77718 <at> debbugs.gnu.org:


Received: (at 77718) by debbugs.gnu.org; 14 Apr 2025 20:30:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 14 16:30:18 2025
Received: from localhost ([127.0.0.1]:49214 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u4QRd-0000Ce-UZ
	for submit <at> debbugs.gnu.org; Mon, 14 Apr 2025 16:30:18 -0400
Received: from mxout5.mail.janestreet.com ([64.215.233.18]:48551)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <sbaugh@HIDDEN>)
 id 1u4QRa-0000B1-Vf
 for 77718 <at> debbugs.gnu.org; Mon, 14 Apr 2025 16:30:15 -0400
From: Spencer Baugh <sbaugh@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are
 broken
In-Reply-To: <jwvlds6crin.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Fri, 11 Apr 2025 17:37:52 -0400")
References: <87y0w7ejxy.fsf@HIDDEN> <86semfp3g9.fsf@HIDDEN>
 <ierh62un94f.fsf@HIDDEN> <ier5xjav609.fsf@HIDDEN>
 <jwvlds6crin.fsf-monnier+emacs@HIDDEN>
Date: Mon, 14 Apr 2025 16:30:09 -0400
Message-ID: <ierikn6bi5q.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com;
 s=waixah; t=1744662609;
 bh=fTifyt80EbSPRduNoqRshB/oGomZMswTa9QmFWbqIIk=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=SXwCLNtfiMvDBJFOSucm/7wcw2FUYCJ2OpbPJlnsoXVVLC9JpajDQv1cwQdI1icCj
 1WqzmTKQCu+7dwua42LP4wdC0gA2hwW+PWlqpwNR6BpwK7+7UOM8TVb5t92pUDUvc2
 7u1t4fbwOqW2JFE4QhimF6pVYdW9Z6XXU5XYH28Xn0usSfa7RpSHoNLMkf3MytTkMB
 92MVeZ0LnyoNrCUzv8OSmG+Na+FsuKGJgXq3U0APSy5VFGkr39fKS9fOIRS/A34DLP
 gT3vELZlHKqWG6An0tRNdvR+s+ODFQEMD8LTsxTsADbD+Suh/Z0L6U7UoTWy1oGier
 rDOCtRnkwKdUg==
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77718
Cc: 77718 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
 Stephen Berman <stephen.berman@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

--=-=-=
Content-Type: text/plain

Stefan Monnier <monnier@HIDDEN> writes:

>> Stefan, a related question: do you think it would be reasonable to split
>> completion-table-with-quoting into two functions, separating the
>> substitute-in-file-name and comint-quote-filename cases?  It seems to me
>> that the comint-quote-filename case is way simpler than the
>> substitute-in-file-name case, and it would be a lot easier to understand
>> if the two cases were done separately, without the abstraction of
>> requote and unquote functions.  I can do that if that seems reasonable.
>> It would make fixing this issue a lot easier.
>
> It's worth a try.  The system we have is the best I could come up with
> back then but is hideous, so I'm interested in a simpler solution.

OK, here is a rework of just the substitute-in-file-name side.  This
fixes this bug (by making completion continue to work when point is at
/usr/|/), and fixes another FIXME in a test (partial completion now
preserves environment variables!).  And I don't think it loses anything
important, but I may be missing something.

(completion--sifn-requote can now be deleted and there are probably
other cleanups possible after this patch, but I didn't do them here to
keep the patch smaller.  Also, rfn-eshadow needs to be updated, but
that's just a visual issue.)


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
 filename=0001-Improve-env-var-handling-in-read-file-name.patch

From 48653fd0b22739f6d836bbe121989f5051502d81 Mon Sep 17 00:00:00 2001
From: Spencer Baugh <sbaugh@HIDDEN>
Date: Mon, 14 Apr 2025 16:01:38 -0400
Subject: [PATCH] Improve env var handling in read-file-name

Fix various bugs, including bug#77718, by rewriting the way file
name completion handles environment variable expansion.  Instead
of using completion-table-with-quoting to manipulate the string
being completed on, simply make the completion table itself
understand substitute-in-file-name.

The completion table first tries to complete without
substituting environment variables; this allows completion to
work on file names which contain things which look like
environment variables.  If that fails, we call
substitute-in-file-name and then complete again.

Tests are updated: we no longer duplicate $s in file names,
since that's not necessary.  And partial-completion now
preserves unexpanded environment variables.  However,
partial-completion no longer works across environment variables
containing delimiters; that's an acceptable sacrifice.

* lisp/minibuffer.el (completion--replace-prefix): Add.
(completion--file-name-table): Rewrite to use
substitute-in-file-name explicitly. (bug#77718)
* test/lisp/minibuffer-tests.el (completion-table-test-quoting)
(minibuffer-next-completion): Update.
---
 lisp/minibuffer.el            | 43 +++++++++++++++++++++++++++++++----
 test/lisp/minibuffer-tests.el | 16 ++++++-------
 2 files changed, 45 insertions(+), 14 deletions(-)

diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index c0ccfc00ce5..4ccf3a1d2f9 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -3596,13 +3596,46 @@ completion--sifn-requote
           (setq qpos (1- qpos)))
         (cons qpos #'minibuffer-maybe-quote-filename)))))
 
-(defalias 'completion--file-name-table
-  (completion-table-with-quoting #'completion-file-name-table
-                                 #'substitute-in-file-name
-                                 #'completion--sifn-requote)
+(defun completion--replace-prefix (s old new)
+  "Replace prefix OLD of string S with prefix NEW."
+  (concat new (substring s (length old))))
+
+(defun completion--file-name-table (orig pred action)
   "Internal subroutine for `read-file-name'.  Do not call this.
 This is a completion table for file names, like `completion-file-name-table'
-except that it passes the file name through `substitute-in-file-name'.")
+except that it passes the file name through `substitute-in-file-name'."
+  (let ((table #'completion-file-name-table))
+    (cond
+     ((eq (car-safe action) 'boundaries)
+      ;; Boundaries are always computed on the original string.
+      (complete-with-action action table orig pred))
+     (;; Ensure we discard text before // by always using sifn in that case.
+      (unless (string-search "//" orig)
+        (complete-with-action action table orig pred)))
+     (t ;; On a nil result, complete again after sifn and adjust the result.
+      (let* ((expansion (substitute-in-file-name orig))
+             (result (complete-with-action action table expansion pred)))
+        (cond
+         ((null action)
+          (if (stringp result)
+              (completion--replace-prefix result expansion orig)
+            result))
+         ((eq action t)
+          ;; Find the part of EXPANSION which is inside the boundaries, and
+          ;; replace it with the part of ORIG which is inside the boundaires.
+          (let* ((expansion-bounds (completion-boundaries expansion table pred ""))
+                 (expansion-in-bounds (substring expansion (car expansion-bounds)))
+                 (orig-bounds (completion-boundaries orig table pred ""))
+                 (orig-in-bounds (substring orig (car orig-bounds))))
+            (if (and (string-empty-p expansion-in-bounds)
+                     (string-empty-p orig-in-bounds))
+                ;; Nothing to replace, so avoid doing unnecessary work.
+                result
+              (mapcar
+               (lambda (s)
+                 (completion--replace-prefix s expansion-in-bounds orig-in-bounds))
+               result))))
+         (t result)))))))
 
 (defalias 'read-file-name-internal
   (completion-table-in-turn #'completion--embedded-envvar-table
diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el
index 59ac5ab9578..38c005bd1b5 100644
--- a/test/lisp/minibuffer-tests.el
+++ b/test/lisp/minibuffer-tests.el
@@ -91,20 +91,18 @@ completion-table-subvert-test
 
 (ert-deftest completion-table-test-quoting ()
   (let ((process-environment
-         `("CTTQ1=ed" "CTTQ2=et/" ,@process-environment))
+         `("CTTQ1=ed" ,@process-environment))
         (default-directory (ert-resource-directory)))
     (pcase-dolist (`(,input ,output)
                    '(
-                     ;; Test that $ in files is properly $$ quoted.
-                     ("data/m-cttq" "data/minibuffer-test-cttq$$tion")
-                     ;; Test that $$ in input is properly unquoted.
-                     ("data/m-cttq$$t" "data/minibuffer-test-cttq$$tion")
+                     ;; Test that files containing $ can be completed
+                     ("data/m-cttq" "data/minibuffer-test-cttq$tion")
+                     ;; Test that $ can be completed
+                     ("data/m-cttq$" "data/minibuffer-test-cttq$tion")
                      ;; Test that env-vars are preserved.
                      ("lisp/c${CTTQ1}et/se-u" "lisp/c${CTTQ1}et/semantic-utest")
-                     ("lisp/ced${CTTQ2}se-u" "lisp/ced${CTTQ2}semantic-utest")
                      ;; Test that env-vars don't prevent partial-completion.
-                     ;; FIXME: Ideally we'd like to keep the ${CTTQ}!
-                     ("lis/c${CTTQ1}/se-u" "lisp/cedet/semantic-utest")
+                     ("lis/c${CTTQ1}/se-u" "lisp/c${CTTQ1}et/semantic-utest")
                      ))
       (should (equal (completion-try-completion input
                                                 #'completion--file-name-table
@@ -690,7 +688,7 @@ minibuffer-next-completion
     (completing-read-with-minibuffer-setup #'read-file-name-internal
       (insert "d/")
       (execute-kbd-macro (kbd "M-<down> M-<down> M-<down>"))
-      (should (equal "data/minibuffer-test-cttq$$tion" (minibuffer-contents))))))
+      (should (equal "data/minibuffer-test-cttq$tion" (minibuffer-contents))))))
 
 (provide 'minibuffer-tests)
 ;;; minibuffer-tests.el ends here
-- 
2.39.3


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77718; Package emacs. Full text available.

Message received at 77718 <at> debbugs.gnu.org:


Received: (at 77718) by debbugs.gnu.org; 11 Apr 2025 21:38:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 11 17:38:03 2025
Received: from localhost ([127.0.0.1]:52037 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u3M4Y-0002f8-MK
	for submit <at> debbugs.gnu.org; Fri, 11 Apr 2025 17:38:03 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:4081)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <monnier@HIDDEN>)
 id 1u3M4W-0002eJ-Cw
 for 77718 <at> debbugs.gnu.org; Fri, 11 Apr 2025 17:38:00 -0400
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id B1CA68075E;
 Fri, 11 Apr 2025 17:37:54 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1744407473;
 bh=r9i1LWPK5N1G6jVJYfib4X6wJtYt716XZmv0dGQDMkg=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=pQLGH9GgDJE2TqCYe0NbkZ8OHCQiuVutem7Bw96NEG+qeBVA+V3ipZU/rFFIUyC8J
 jlpx6uhvxEvzmrAXo5YwiPU20RGjcdTwpMKndpuS6Ecf1011CpCLcclhS8nW2VZ5v9
 otMFQcIBz/L80myoWgHdDzIlupW6ZPjS3nmYfTDhmZ3kXYPQxtMI5vX1G/iR9ENiWj
 F+AXvNaZmhJAgB0uO1a1Hu4koUaBPM3YcxgWrEkKo1pLFm0aN7Ewf8s9ee7opxpxXA
 JBCNJxllsOWmz4IX8V3+ZmJnOQINrlfxe6Sa/cPRL7DaoIa056JLYxLpaxtThm3uJU
 V//jhSngLDG/Q==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id E8662804C9;
 Fri, 11 Apr 2025 17:37:53 -0400 (EDT)
Received: from pastel (unknown [104.247.242.5])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B9CCF120491;
 Fri, 11 Apr 2025 17:37:53 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are
 broken
In-Reply-To: <ier5xjav609.fsf@HIDDEN>
Message-ID: <jwvlds6crin.fsf-monnier+emacs@HIDDEN>
References: <87y0w7ejxy.fsf@HIDDEN> <86semfp3g9.fsf@HIDDEN>
 <ierh62un94f.fsf@HIDDEN> <ier5xjav609.fsf@HIDDEN>
Date: Fri, 11 Apr 2025 17:37:52 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.363 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77718
Cc: 77718 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
 Stephen Berman <stephen.berman@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Stefan, a related question: do you think it would be reasonable to split
> completion-table-with-quoting into two functions, separating the
> substitute-in-file-name and comint-quote-filename cases?  It seems to me
> that the comint-quote-filename case is way simpler than the
> substitute-in-file-name case, and it would be a lot easier to understand
> if the two cases were done separately, without the abstraction of
> requote and unquote functions.  I can do that if that seems reasonable.
> It would make fixing this issue a lot easier.

It's worth a try.  The system we have is the best I could come up with
back then but is hideous, so I'm interested in a simpler solution.

> (I don't think we need to maintain the same interface for
> completion-table-with-quoting - I see no usage in the 200 packages used
> at my site - I strongly suspect, given the complexity, that the only
> users are in Emacs core)

It's definitely not worth worrying about that while designing
a replacement.  Maybe we'll want to preserve backward compatibility, but
let's first get a good replacement.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77718; Package emacs. Full text available.

Message received at 77718 <at> debbugs.gnu.org:


Received: (at 77718) by debbugs.gnu.org; 11 Apr 2025 19:43:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 11 15:43:27 2025
Received: from localhost ([127.0.0.1]:51833 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u3KHe-0005Uc-SJ
	for submit <at> debbugs.gnu.org; Fri, 11 Apr 2025 15:43:27 -0400
Received: from mxout5.mail.janestreet.com ([64.215.233.18]:41145)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <sbaugh@HIDDEN>)
 id 1u3KHc-0005UI-Ce
 for 77718 <at> debbugs.gnu.org; Fri, 11 Apr 2025 15:43:24 -0400
From: Spencer Baugh <sbaugh@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are
 broken
In-Reply-To: <ierh62un94f.fsf@HIDDEN> (Spencer Baugh's message of
 "Fri, 11 Apr 2025 09:03:12 -0400")
References: <87y0w7ejxy.fsf@HIDDEN> <86semfp3g9.fsf@HIDDEN>
 <ierh62un94f.fsf@HIDDEN>
Date: Fri, 11 Apr 2025 15:43:18 -0400
Message-ID: <ier5xjav609.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com;
 s=waixah; t=1744400598;
 bh=GxA76DkoznxhbDcdZQ8VePv5IYzWl0ptkngY09Wq8ys=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=rHoI0GwM3U8JFgClphp30/9YWZBSZu7PrpDnjoAPBVr7yR1EhEEbFKjv4YiWFhMer
 BOHqQp2VDZwc2HRGgb9aA2MT2RLE8UCIsKLYiV/xIGd5H/bk6scuF23J1Hjc9Y1ZV4
 BicfNTYn2Lg+Nw4gfaxBLFHy5/v0k+O2aa6lUTlMQxKWrBFHLafsNti67Hpjp1vZ/m
 QAIeCzf5vuXrTyXPhEAu5hHVS/p/oZv+pBtXMhAno/GNuxly8BWe056KhO+EieCpiE
 uj3oOT0VHG88IGftiSM21rwxmKzfzOd6rovzVicwc1YC9Swvou4mK5I997f+wHphaa
 NiqK9n2GSvVyw==
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77718
Cc: 77718 <at> debbugs.gnu.org, Stephen Berman <stephen.berman@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Spencer Baugh <sbaugh@HIDDEN> writes:
> Reduced slightly, the issue is that
>   (completion-pcm--merge-completions '("x/" "y/") '(prefix))
> now returns 
>   ("/" any prefix "" "")
> when it used to return
>   (any "" "")
>
> I think this may be related to the implict "any" added by
> completion-pcm--merge-completions.  I'll look into it and find a fix
> (and add a test covering this case).

Update: That's not the issue; this new return value for
completion-pcm--merge-completions is actually correct, it's a desirable
consequence of my bugfix patch.

The issue is actually in completion-table-with-quoting, with filename
completion and substitute-in-file-name; it doesn't handle // properly.

I'm trying to fix it; it may be a somewhat large change to
completion-table-with-quoting.

Stefan, a related question: do you think it would be reasonable to split
completion-table-with-quoting into two functions, separating the
substitute-in-file-name and comint-quote-filename cases?  It seems to me
that the comint-quote-filename case is way simpler than the
substitute-in-file-name case, and it would be a lot easier to understand
if the two cases were done separately, without the abstraction of
requote and unquote functions.  I can do that if that seems reasonable.
It would make fixing this issue a lot easier.

(I don't think we need to maintain the same interface for
completion-table-with-quoting - I see no usage in the 200 packages used
at my site - I strongly suspect, given the complexity, that the only
users are in Emacs core)




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77718; Package emacs. Full text available.

Message received at 77718 <at> debbugs.gnu.org:


Received: (at 77718) by debbugs.gnu.org; 11 Apr 2025 13:03:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 11 09:03:21 2025
Received: from localhost ([127.0.0.1]:49490 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u3E2S-00044I-Ky
	for submit <at> debbugs.gnu.org; Fri, 11 Apr 2025 09:03:21 -0400
Received: from mxout5.mail.janestreet.com ([64.215.233.18]:55185)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <sbaugh@HIDDEN>)
 id 1u3E2P-000443-KL
 for 77718 <at> debbugs.gnu.org; Fri, 11 Apr 2025 09:03:18 -0400
From: Spencer Baugh <sbaugh@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are
 broken
In-Reply-To: <86semfp3g9.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 11 Apr
 2025 10:22:46 +0300")
References: <87y0w7ejxy.fsf@HIDDEN> <86semfp3g9.fsf@HIDDEN>
Date: Fri, 11 Apr 2025 09:03:12 -0400
Message-ID: <ierh62un94f.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com;
 s=waixah; t=1744376592;
 bh=cUg2T6YtXqy6vhR7N0OeEwM4x63joJL9Lp5RoIC2qw0=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=tx4kXTqnHPONaIn6DTQYq+/rPeTwa85rlb94e9QNVdvem5VFkUaknp+I9Fv7vjgZj
 8MwzWlTDU2XZMqOl7g2FWMYqA1ZwTHeN1ekSMDCGJgKGibjCYKV8M8JbgJXXXwMRgv
 PoR1CihO4GH/PZ/aUmWGSO0ai1Kz5rM7WURcuM3mGuwJl+b14t7w9Vug2xpYp/cHVC
 g+vEmo4T7SD+rQU6H3e9vZdaRANasC7/z3E/mw7d864qB/YGNf7wbrJNApFAMfKkQm
 HrImVE0r9bLa1yKZ10GiiiFkklNlDSROhb3pRZaFGlJ9A+h5p+ySAo47uK8e4Z3k6v
 IGSUUaHXZcEvw==
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77718
Cc: 77718 <at> debbugs.gnu.org, Stephen Berman <stephen.berman@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Eli Zaretskii <eliz@HIDDEN> writes:
>> Date: Fri, 11 Apr 2025 00:22:01 +0200
>> From:  Stephen Berman via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
>> 
>> 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@HIDDEN>
>> Commit:     Stefan Monnier <monnier@HIDDEN>
>> 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)

Thanks for the detailed bug report.

Reduced slightly, the issue is that
  (completion-pcm--merge-completions '("x/" "y/") '(prefix))
now returns 
  ("/" any prefix "" "")
when it used to return
  (any "" "")

I think this may be related to the implict "any" added by
completion-pcm--merge-completions.  I'll look into it and find a fix
(and add a test covering this case).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77718; Package emacs. Full text available.

Message received at 77718 <at> debbugs.gnu.org:


Received: (at 77718) by debbugs.gnu.org; 11 Apr 2025 07:23:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 11 03:23:03 2025
Received: from localhost ([127.0.0.1]:48420 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u38j8-0007MP-MU
	for submit <at> debbugs.gnu.org; Fri, 11 Apr 2025 03:23:03 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:38292)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1u38j5-0007Lp-3V
 for 77718 <at> debbugs.gnu.org; Fri, 11 Apr 2025 03:23:00 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1u38ix-0006kB-Hn; Fri, 11 Apr 2025 03:22:51 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=xSksW5hxieoxbyzZsRSfeizWKGzxY3vIWb/J84izhT4=; b=q5btHb0POv49
 f2IlaRKOG2bzOGRu0KQT3cnDmP6NnuPmntSSjzfdnRMkUEi1+ahC571rYbbdKiBpv+PfG2X/ADo7p
 GCu9LaeE/2wUQllv2dChg+e7vrAoitohcPL1dqVZhll46YkA8g1RymUVvKUFxp1why0MlvKLsXYOZ
 RF1+wcDnSshsixiqc+fh5Fh+ljvX4nVryeWY+NxhVnRKa9bYlu0IQ4gHXpFYCZe/TdO/WNHlt6A0w
 BIDyF+aBas+WK9Iie7xucjpg7B1YTigBpt21SoTDJVT0JklZqHB/ANHTY/aBSUyLzMRC+d5xMUNdb
 yG+rSSFRBzEQKNAkN+6/QQ==;
Date: Fri, 11 Apr 2025 10:22:46 +0300
Message-Id: <86semfp3g9.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stephen Berman <stephen.berman@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>,
 Spencer Baugh <sbaugh@HIDDEN>
In-Reply-To: <87y0w7ejxy.fsf@HIDDEN> (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#77718: 31.0.50;
 completion styles substring and flex are broken
References: <87y0w7ejxy.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77718
Cc: 77718 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Fri, 11 Apr 2025 00:22:01 +0200
> From:  Stephen Berman via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> 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@HIDDEN>
> Commit:     Stefan Monnier <monnier@HIDDEN>
> 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)

Thanks, adding the guilty parties to the discussion.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77718; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 10 Apr 2025 22:22:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 10 18:22:38 2025
Received: from localhost ([127.0.0.1]:47442 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u30IA-0001NA-2a
	for submit <at> debbugs.gnu.org; Thu, 10 Apr 2025 18:22:38 -0400
Received: from lists.gnu.org ([2001:470:142::17]:42598)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <stephen.berman@HIDDEN>)
 id 1u30I6-0001M6-AK
 for submit <at> debbugs.gnu.org; Thu, 10 Apr 2025 18:22:34 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <stephen.berman@HIDDEN>)
 id 1u30Hm-0001vZ-KI
 for bug-gnu-emacs@HIDDEN; Thu, 10 Apr 2025 18:22:22 -0400
Received: from mout.gmx.net ([212.227.17.20])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <stephen.berman@HIDDEN>)
 id 1u30Hh-0006ay-Ez
 for bug-gnu-emacs@HIDDEN; Thu, 10 Apr 2025 18:22:14 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net;
 s=s31663417; t=1744323724; x=1744928524; i=stephen.berman@HIDDEN;
 bh=l0QdhmYqhcvJBYMX9h2HghfuQ5lyUT2gs6vHtxRUs60=;
 h=X-UI-Sender-Class:From:To:Subject:Date:Message-ID:MIME-Version:
 Content-Type:Content-Transfer-Encoding:cc:
 content-transfer-encoding:content-type:date:from:message-id:
 mime-version:reply-to:subject:to;
 b=XHCr6T3T2Wl0t5wMrWEsf/V1FAt7vcxjphTln8t+XjOylpEdOROyWiwI/fiztRgG
 J04T7oKpPDADuZSsJUE0L+itj5xE6N+WYnwBGr8A6bGKoIJ8ee7Etl5h/IZo8IXa2
 kKsjD/YVtEn24tPWivlBLg6qEP1vJPVeq2n/PH7s0r4HkDrR8cGNaewmIQY33e9kQ
 tdV4ze44CP0NBNJ2E7UO0nKgWEIs+pKIhv/FughPXvISa9TEPThrOAZEE7Z07bdRE
 919sSOClpaDupTLR7XuxRPeXx8M7/rrvVV2GHZcsWlv/9HABENewjiFelXvsJ277Y
 ioucTAIjtMW0FH34BQ==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from strobelfs2 ([94.134.94.12]) by mail.gmx.net (mrgmx105
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MowKc-1tGFfu2qX0-00oChA for
 <bug-gnu-emacs@HIDDEN>; Fri, 11 Apr 2025 00:22:04 +0200
From: Stephen Berman <stephen.berman@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 31.0.50; completion styles substring and flex are broken
Date: Fri, 11 Apr 2025 00:22:01 +0200
Message-ID: <87y0w7ejxy.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:MowRBtdUMBpN1HDiqagIyU9xgd5jhlPvGM8z+vQ8nkFRcVSQ5Ct
 gTWp5ffQt4iMh4hGetCOvUjfsJhzjecTtkeOFwAm0qBsrNbPY7BzHdH2UIgpPgctTnOAMqd
 lfuyKpTvg/7ACBB0nH9R6NpReujzI/iHoX6GkPDovxH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0PdEQXhRwzGSdFcZTb3y36oww2LLnO8nBcdHJjdLJNzM8UiBTyh8TEqA5hZX9
 Wv+eZd0EcSQOMuZssBsx2ybCjyKbutcvDT4gMEXllF6
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=212.227.17.20;
 envelope-from=stephen.berman@HIDDEN; helo=mout.gmx.net
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
 RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

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'.
=3D> Now the text following the prompt is this: "/usr//" and "/usr/" is
fontified with face file-name-shadow.

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

3. Type `TAB' again.
=3D> 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@HIDDEN>
Commit:     Stefan Monnier <monnier@HIDDEN>
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=3D-Og -g3' PKG_CONFIG_PATH=3D/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




Acknowledgement sent to Stephen Berman <stephen.berman@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#77718; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 15 Apr 2025 11:30:02 UTC

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