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

From: Eli Zaretskii <[email-masked]>
Date: Wed, 16 Apr 2025 10:31:25 +0300

> From: Spencer Baugh <[email-masked]>
> Cc: [email-masked],  [email-masked],  [email-masked]
> Date: Tue, 15 Apr 2025 15:24:45 -0400
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> >> From: Spencer Baugh <[email-masked]>
> >> Cc: [email-masked],  Eli Zaretskii <[email-masked]>,  Stephen Berman
> >>   <[email-masked]>
> >> 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.
> 
> Ah, thanks, good point.  I updated it to remove this hardcoded handling
> of //, and instead defer to substitute-in-file-name, which will behave
> right on Windows.  Updated patch attached.
> 
> > 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.
> 
> Can do, I'm working on setting up a test Windows system right now.

Thanks.

> Is there any way to approximately test the behavior of Windows file name
> completion while still on GNU/Linux?  It might be useful to have tests
> which can run on GNU/Linux but test the Windows behavior.

Unfortunately, this is not possible, because portions of the relevant
code in C are only compiled into the Windows build of Emacs.