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

From: Michael Albinus <[email-masked]>
Date: Tue, 04 Nov 2014 19:47:24 +0100

Glenn Morris <[email-masked]> writes:

> Eli Zaretskii wrote:
>
>>> if a directory name happens to match a tramp pattern, as "/C:"
>>> presumably does, how about first checking if a local directory literally
>>> named that exists, before invoking a remote handler?
>>
>> That's probably something Emacs should do _before_ invoking the
>> handler, no?  I mean, the decision whether to let the handler do this
>> job is outside the scope of the handler.
>
> That's what I meant, I think...

There could be undesired side effects. File name handlers are invoked
only if the file *name* matches a corresponding regexp, nothing else. If
you want to make checks on the file system itself, it would result at
least in performance penalties.

Not to speak about cases where it is not possible.

(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.

Best regards, Michael.