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

Previous Next

Package: emacs;

Reported by: jeberger <at> free.fr

Date: Fri, 24 Feb 2023 07:40:01 UTC

Severity: normal

Found in version 27.2

Done: João Távora <joaotavora <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #68 received at 61748 <at> debbugs.gnu.org (full text, mbox):

From: jeberger <at> free.fr
To: João Távora <joaotavora <at> gmail.com>
Cc: Michael Albinus <michael.albinus <at> gmx.de>, 61748 <at> debbugs.gnu.org
Subject: Re: bug#61748: 27.2; Eglot should use shell-file-name when
 launching the language server for a remote file
Date: Tue, 28 Feb 2023 14:59:32 +0100 (CET)
João Távora <joaotavora <at> gmail.com> writes:
> Michael Albinus <michael.albinus <at> gmx.de> writes:
> 
> > 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 <at> 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.
> 
No I've already got it setup as part of my config before I ever access
Tramp, which seems only logical: first configure the environment, then
try to use it.

Just to be clear, which problem are we talking about here? There were
two related problems in my report:

1. When told that the language server is `rust-analyzer`, Eglot fails
   to launch it. This is caused by the hardcoded `"sh" "-c"` in
   `eglot--cmd` and is fixed by using `(or shell-file-name "sh")
   (or shell-command-switch "-c")`, possibly with an added
   `with-connection-local-variables` as per Michael's mail.
   Or maybe by removing the whole `eglot--cmd` function since from
   the comment it looks like it only exists to call `stty raw` for
   remote files, and Eglot is the only package that tries to do that.
   This can only be fixed in Eglot since that's where it's hardcoded.

2. Eglot doesn't detect `rust-analyzer` automatically. This could be
   related to the fact that `rust-analyzer` is in a non-standard path
   or to some mix-up between the local and remote environments (e.g.
   if Eglot tries to detect the server on the local PC even though it
   would need the remote one), or something else altogether. It is not
   fixed by the abovementioned changes. 
   I have no idea how Eglot tries to determine which server it should
   use, and so no idea where to start looking for a solution.

Jérôme




This bug report was last modified 2 years and 161 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.