Subject: Re: bug#23006: 25.0.92; Loading Tramp breaks pcomplete in eshell-mode

From: Michael Albinus <[email-masked]>
Date: Thu, 17 Mar 2016 20:49:53 +0100

Stefan Monnier <[email-masked]> writes:

>>>> I'm getting the error 'tramp-file-name-handler: Host name must not match
>>>> method "adb"'.
> [...]
>>   tramp-check-proper-method-and-host([#("scp" 0 3 (tramp-default t))
>> nil "davs" "" nil])
>>   tramp-maybe-open-connection([#("scp" 0 3 (tramp-default t)) nil
>> "davs" "" nil])
>>   tramp-send-command([#("scp" 0 3 (tramp-default t)) nil "davs" ""
>> nil] "cd ~ && pwd")
>>   tramp-sh-handle-expand-file-name("/davs:" nil)
>>   apply(tramp-sh-handle-expand-file-name ("/davs:" nil))
>>   tramp-sh-file-name-handler(expand-file-name "/davs:" nil)
>>   apply(tramp-sh-file-name-handler expand-file-name ("/davs:" nil))
>>   tramp-file-name-handler(expand-file-name "/davs:" nil)
>>   expand-file-name("/davs:" nil)
>>   apply(expand-file-name ("/davs:" nil))
>>   tramp-completion-run-real-handler(expand-file-name ("/davs:" nil))
>>   tramp-completion-file-name-handler(expand-file-name "/davs:" nil)
>>   file-name-all-completions("" "/davs:")
>>   completion-file-name-table("/davs:" #[257
>
> completion-file-name-table calls (file-name-all-completions "" "/davs:")
> because (file-name-directory "/davs:") returns "/davs:" which seems
> wrong if "/davs:" is not a valid directory name.

What do you expect (file-name-directory "/davs:") to return else?
`file-name-directory' is not expected to check, whether a given argument
is a valid file name. The docstring says "Given a Unix syntax file name,
returns a string ending in slash.".

And yes, in this case no trailing slash is added. Hmm, maybe it shall
return "/davs:./". Would this be better?

>         Stefan

Best regards, Michael.