Subject: Re: bug#18891: Doesn't handle pwd = /C: very well

From: Michael Albinus <[email-masked]>
Date: Tue, 04 Nov 2014 20:36:38 +0100

Glenn Morris <[email-masked]> writes:

> I don't consider a performance penalty an undesired side effect, but
> rather necessary to avoid a completely incorrect result, such as we have
> in this case.

The "unnecessary result" is an error in `file-attributes'.

>> (substitute-in-file-name "/C:/$FOO") requires the expansion of
>> $FOO. That's the task of Tramp, according to that file name. Nothing you
>> can check before invoking Tramp, because you don't know the value of $FOO.
>
> Why can't it be checked before Tramp?
>
> What if "FOO = foo" in the local environment, and "/C:/foo"
> is a real directory on the local machine?

`substitute-in-file-name' is an operation supporting file name
handlers. This handler must be called, instead of expanding an
environment variable locally. That's the design, and the promise by the
API.

Everything could be changed, of course. But please then with a
corresponding *design* change. And `substitute-in-file-name' was just
the very first example which came to my mind, without thinking about
seriously. There are many other operations supporting file name
handlers, which must be investigated for this kind of changes as well.

For the records: I do not oppose fundamentally such changes. I just
resist to change something on-the-fly, without redesign.

Best regards, Michael.