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

From: Stefan Monnier <[email-masked]>
Date: Thu, 24 Mar 2016 11:56:17 -0400

>> The question is: does Tramp need to know whether or not this
>> `directory-files', or `file-directory-p' (or
>> `file-name-all-completions', which may also be called in non-completion
>> contexts) is called as part of a completion operation?
>
> A general purpose function cannot know.
> file-name-all-completions cannot know either, because it can be called
> outside of completion context.
>
> A completion UI cannot know, in general, because it can be used to complete
> just about anything, and it doesn't always know what it's completing.

AFAIK, by definition, a completion UI knows that it's performing completion.
So, I don't see much difficulty in telling Tramp that we're
performing completion: just let-bind some new `in-completion' variable
in the few completion UIs we have.

The problem is that I don't see any reason why Tramp would need to know.

        Stefan