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

From: [email-masked]
Date: Wed, 1 Mar 2023 11:01:54 +0100 (CET)

"Michael Albinus" <[email-masked]>wrote:
> You're right. I'm working with Emacs 30.0.50, and my example is fine
> there. In Emacs 27, custom-set-variables requires that the respective
> library is loaded already. So please try instead
> 
> --8<---------------cut here---------------start------------->8---
> # emacs -Q -l tramp --eval "(custom-set-variables '(tramp-remote-path
> '(tramp-own-remote-path tramp-default-remote-path)))"
> --8<---------------cut here---------------end--------------->8---
> 
No change. Note that AFAICT `tramp-remote-path` is the only custom
variable that is affected. I suspect that this is because there is
a `(defvar tramp-remote-path …)` in `tramp-loaddefs.el` in addition
to the `(defcustom tramp-remote-path …)` from `tramp-sh.el`.

This is with the builtin Tramp in Emacs 27. I just tried installing
Tramp 2.6.0.2 from Elpa and `tramp-remote-path` is set properly
(but trying to open a remote file fails with a missing symbol error,
probably due to an out-of-date dependency).

So the issue appears to be fixed in the latest Tramp, and for the time
being I can work around it using `eval-after-load` to force-set the
path, e.g. this works:

```
emacs -Q -l tramp --eval "(eval-after-load 'tramp '(setq tramp-remote-path '(tramp-own-remote-path tramp-default-remote-path)))"
```

Thanks,
Jérôme