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

From: Stefan Monnier <[email-masked]>
Date: Fri, 18 Mar 2016 12:06:45 -0400

> What do you expect (file-name-directory "/davs:") to return else?

IIUC "/davs:hello.c" is parsed as a reference to a file on the host
"davs" and we nowadays signal an error in that case telling the user to
use an explicit "/ssh:davs:hello.c" instead.

At least that's how I interpret the

   tramp-file-name-handler: Host name must not match method "davs"

(replace "davs" with "adb" and friends depending on your particular
case) we get in the recipe.

So, assuming this interpretation is correct, I think "/davs:" should not
be considered a valid "directory" name.

So I see two options:

- (file-name-directory "/davs:") returns "/"
- (file-name-directory "/davs:") returns "/davs:" and Tramp accepts
  (file-name-all-completions "" "/davs:") without signaling an error.

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

I don't know what are the tradeoffs in this regard, so I have no
preference in this regard.  But what (file-name-directory "/davs:")
returns should be a directory name that file-name-all-completions can
use and to the extent that "/davs:" is the prefix of valid file names,
file-name-all-completions should not signal an error (it's acceptable if
it doesn't actually lists all those valid file names, OTOH).

        Stefan