On Tue, Apr 15, 2025 at 2:26 AM Eli Zaretskii <eliz@gnu.org> wrote:
> From: Spencer Baugh <sbaugh@janestreet.com>
> Cc: 77718@debbugs.gnu.org,  Eli Zaretskii <eliz@gnu.org>,  Stephen Berman
>   <stephen.berman@gmx.net>
> 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:


-Stephane