Subject: bug#65356: 30.0.50; [wishlist] Support Tramp method, user name and host name completion in eshell

From: Jim Porter <[email-masked]>
Date: Fri, 18 Aug 2023 20:26:54 -0700

On 8/18/2023 3:33 PM, Stefan Monnier via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:
>> Yes. However, there is already another problem in shell-mode. My patch
>> completes only incomplete Tramp file names, like "/ss". Complete Tramp
>> file names are handled by pcomplete-dirs already. So we see in a *shell*
>> buffer, w/o my patch:
> 
> Good point.
> 
> Still, we have the problem that `pcomplete/<CMD>` should be used only
> for external commands (because they are independent from the language
> used to write the command, a.k.a the shell), but for things like `cd` we
> should be more precise to distinguish the completion rules for Eshell's
> `cd` from those of bash's `cd`.

That should be possible by defining 'pcomplete/eshell-mode/CMD', but 
that runs into two issues: 1) it's annoying to manually write all of 
these, and 2) there may be other contexts in Eshell we want to 
tab-complete remote directories that aren't covered by the 
command-specific Pcomplete functions like that.

(#1 should be fixable with a new version of 'eshell-eval-using-options', 
but I haven't looked at that in much detail yet.)