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

From: Michael Albinus <[email-masked]>
Date: Sat, 19 Mar 2016 16:28:21 +0100

Stefan Monnier <[email-masked]> writes:

>> non-essential comes in play only when hostname completion hasn't been
>> finished.
>
> Could you expand on this?
>
> Do you mean when completing things like "/ssh:toto" ?
> In that case I agree that Tramp shouldn't open a connection, but I think
> this should be regardless of non-essential.

I'm not speaking about opening a connection. This is controlled
independent of non-essential settings.

I'm speaking about this error, that Tramp reports "/adb:" not being a
valid hostname. This does not happen if non-essential is bound to
non-nil, indicating to Tramp that the given filename is not complete yet.

> But do you also mean that completing "/ssh:host:tmp/ema" will open a new
> connection regardless of non-essential?  If so, as mentioned I think
> that would be a mistake.

I don't believe it is a mistake. The presence of a slash indicates to
Tramp, that the (Emacs) user has provided everything what's needed to
say about method, (remote) user, and hostname to Tramp. So it is safe to
open the connection. Otherwise, you would never be able to complete
local pathnames for remote hosts, if the connection hasn't been
established yet. Inconvenient.

It is my daily scenario to type

C-x C-f / / / s s h : h o s <TAB> / u s <TAB>

The leading slashes are needed because I work usually on other remote
machines in parallel. It's my typing style to start with three
consecutive slashes :-)

The first <TAB> completes to "/ssh:host:" The second <TAB> completes to
"/ssh:host:/usr". And so on.

I also perform very often "ediff" over machine boundaries. Usually, the
first filename is on the machine I'm working on, and the second filename
on another machine on a similar location. Once I have started ediff, I
want to complete the (slightliy) different pathname of the second file
while being asked from ediff for that filename. If I would need to open
a connection to the second host in advance, this workflow would be
impossible.

>> This is how Tramp behaves for years. I haven't heard complaints about
>> (except the cases non-essential isn't let-bound, like the one we're
>> discussing here).
>
> Sounds like we agree, then: this should not be affected by non-essential.

Yes, here we agree. Opening a new connection is not related to non-essential.

>         Stefan

Best regards, Michael.