Subject: bug#61748: 27.2; Eglot should use shell-file-name when launching the language server for a remote file

From: João Távora <[email-masked]>
Date: Tue, 28 Feb 2023 12:18:22 +0000

Michael Albinus <[email-masked]> writes:

> João Távora <[email-masked]> writes:
>
> Hi João,
>
>>     ~/Source/Emacs/emacs/src/emacs -Q                                                 \
>>        /ssh:sshuser@localhost#2022:$REMOTE_FILE                                       \
>>        --eval '(add-to-list (quote tramp-remote-path) "~/bin")'                       \
>>        -f eglot
>
> You must set tramp-remote-path before accessing the remote server. Try this:
>
>      ~/Source/Emacs/emacs/src/emacs -Q -l tramp                                        \
>         --eval '(add-to-list (quote tramp-remote-path) "~/bin")'                       \
>         /ssh:sshuser@localhost#2022:$REMOTE_FILE                                       \
>         -f eglot

This works, and this would explain the instability I saw earlier.
Thanks.  I wonder if it fixes Jerôme's problem, too.

But IMHO this is a grim pain point for Eglot users expecting things to
"just work".  After all, there I am in the other side thread singing the
praises of Tramp's "transparency", and now it seems that the user be
aware of this Tramp implementation detail -- the early binding of
tramp-remote-path.

Surely we can fix this in Tramp, so that it either considers this
variable's value just-in-time, or detects if there were changes to it
and reacts accordingly.  Can we not?

João