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

From: Drew Adams <[email-masked]>
Date: Sun, 20 Mar 2016 08:38:10 -0700 (PDT)

> "... it can be used to prevent Tramp from prompting the
> user for a password when we are simply scanning a set of files in the
> background or displaying possible completions before the user even asked
> for it."

Those are two examples.  More generally, it can be used to prevent
Tramp from prompting _for any reason_ and _in any context_ where a
file name is read (any context where Tramp is invoked - e.g. by a
file handler).

> If the user has typed "/ssh:host:tmp/ema", and she requests for
> completion by typing TAB, the existence of the slash in the local file
> name part is an indication that "the user even asked for it" (completion
> on "host").
> 
> Without the slash in the local file name, Tramp does not perform
> completion on "host" when there is no connection yet. In a previous
> message I was wrong about this, saying that completion happens already
> when there are two colons.

Those are explanations of why someone using vanilla Emacs might
want to inhibit Tramp from prompting.  They might be sufficient
reasons for Tramp not to prompt, in that vanilla context.

But they are not _necessary_ conditions to inhibit prompting.

Phrases such as "by typing TAB" and "slash in the local file name
part" are inappropriate considerations here.  They do not belong
in a Tramp consideration of what it means for `non-essential' to
be non-nil.

Tramp should simply honor `non-essential' without question.  It
is not Tramp's business what the reasons might be for inhibiting
its prompting.  It should not make any assumptions about the kind
of completion being used or the mechanism of completion - or even
whether any completion is currently being done.  It should not
care why it is being inhibited from prompting - no second-guessing.

It should not even look at the input string if `non-essential'
is non-nil.  If it is non-nil then Tramp should not consider
perhaps prompting if the input string is this or that or contains
this or that.  If non-nil then hands-off, please - no questions
asked.

It is typically the file-name reading code that binds/sets
`non-essential', and it is up to whatever code that does that
to decide whether Tramp should be able to prompt for connection
info (password etc.).

Tramp needs to keep its hands off if `non-essential' is non-nil,
and not second-guess _why_ it is non-nil and what that might
really mean to the code that made it non-nil.

Of course, it's possible I'm missing something big here, in
which case I apologize.  But my impression from what I've seen
so far is that you are now digging into the weeds in territory
where Tramp does not really belong.