Subject: Re: bug#16577: Add regexp-based version of completion-ignored-extensions

From: Stefan Monnier <[email-masked]>
Date: Mon, 21 Feb 2022 11:06:52 -0500

> I haven't looked at the various code snippets that use the resulting
> regexps, but I imagine that some are matching on the full file name and
> some aren't?

I think the important case only has the nondirectory part of the file
name at hand, which is why I propose for "/<RE>" to be defined as
matching only on that part (with a terminating / if it's a directory).

> But do you mean that completion-ignored-files should be on the form
> (... "/CV[A-S]/" ...)?

If we want to ignore .../CVA/, .../CVB/, etc yes.

>> We'd probably want to make this match anchored, since that's
>> what the "/" suggests.  It means that instead of "/.git/" we'd add
>> "/\\.git/" or "/\\.git/?\\'".
>
> If we want this to work against both full file names and nondirectory
> parts, it'd be...  er...
>
> "\\(?:\\`\\|/\\)\\.git/?\\'"

No, the "/" would look like it's matching the / of a full file name, but
it would really be just a marker to indicate that the rest is a regexp
(and where it's anchored) and the matching code would extract the regexp
from it (and replace it with the equivalent of \\(?:\\`\\|/\\) as
needed).

        Stefan