Subject: Re: bug#4823: w32 paths `substitute-in-file-name' fails when environmental variable is set for \\ style paths:

From: Stefan Monnier <[email-masked]>
Date: Wed, 28 Oct 2009 20:43:33 -0400

> According to the docstring of `substitute-in-file-name':

>   If `//' appears, everything up to and including the first of
>   those `/' is discarded.

Admittedly, I think substitute-in-file-name implements this feature
incorrectly, because the double-slash handling should be done before
envvar expansion (envvars ceom from outside Emacs usually, so they
generally rely on the convention that /foo///bar is equivalent to
/foo/bar rather than to /bar).

OTOH if an envvar holds "http://foo/bar", then we'd want to use
url-handler-mode's implementation of substitute-in-file-name, which
would argue for doing expansion early.  It's probably tricky to get it
to do the right thing in "all" cases.

        Stefan