Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken

From: Stefan Monnier <[email-masked]>
Date: Tue, 15 Apr 2025 17:50:44 -0400

>> Why?  `substitute-in-file-name` presumably already takes care of that:
>>
>>     (substitute-in-file-name "/foo/$NOTAVAR/bar")
>>     => "/foo/$NOTAVAR/bar"
>
> To support completing file names that look like environment variables,
> without the need to quote $ by duplicating it.

I don't understand: the example I show above suggests you can do that
without doing anything special.

[ Also, I'm not sure it's worth the trouble anyway: dollars in file names
  are fairly rare, so having to double them in those rare cases where they
  occur is not a big deal.  In any case, it seems orthogonal to the
  problem at hand.  ]

>>> Tests are updated: we no longer duplicate $s in file names,
>>> since that's not necessary.
>> AFAIK it is still needed for the (null action) case.
> Why would that be?  I believe quoting $ should no longer be necessary.

Say I have a file

    ~/tmp/foo$HOME.txt

and I do

    C-x C-f ~/tmp/foo TAB

AFAIK it needs to complete to

    ~/tmp/foo$$HOME.txt

otherwise the file name returned by `read-file-name` will be

    ~/tmp/foo/home/monnier.txt

> Indeed, I will, just avoiding that for now while iterating on the patch.

+1

        Stefan