From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: jeberger@free.fr Newsgroups: gmane.emacs.bugs Subject: bug#61748: 27.2; Eglot should use shell-file-name when launching the language server for a remote file Date: Tue, 28 Feb 2023 15:49:18 +0100 (CET) Message-ID: <76634814.7170555.1677595758208.JavaMail.root@zimbra60-e10.priv.proxad.net> References: <774021794.15662399.1677224385920.JavaMail.root@zimbra60-e10.priv.proxad.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12251"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Michael Albinus , 61748@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 28 15:50:25 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pX1J9-0002xF-10 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Feb 2023 15:50:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pX1Is-0003C6-04; Tue, 28 Feb 2023 09:50:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pX1Ip-0003Bb-BR for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2023 09:50:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pX1Io-00014H-O4 for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2023 09:50:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pX1Io-0001sV-K8 for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2023 09:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: jeberger@free.fr Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Feb 2023 14:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61748 X-GNU-PR-Package: emacs Original-Received: via spool by 61748-submit@debbugs.gnu.org id=B61748.16775957747177 (code B ref 61748); Tue, 28 Feb 2023 14:50:02 +0000 Original-Received: (at 61748) by debbugs.gnu.org; 28 Feb 2023 14:49:34 +0000 Original-Received: from localhost ([127.0.0.1]:50059 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pX1IH-0001rc-22 for submit@debbugs.gnu.org; Tue, 28 Feb 2023 09:49:34 -0500 Original-Received: from smtp3-g21.free.fr ([212.27.42.3]:38708) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pX1IA-0001r7-3f for 61748@debbugs.gnu.org; Tue, 28 Feb 2023 09:49:27 -0500 Original-Received: from zimbra60-e10.priv.proxad.net (unknown [172.20.243.210]) by smtp3-g21.free.fr (Postfix) with ESMTP id 46BF713F838; Tue, 28 Feb 2023 15:49:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=free.fr; s=smtp-20201208; t=1677595758; bh=zlNE/h82v/abOnSFUmk3fOtkFkJ7hK6ZsA3btGxfC4I=; h=Date:From:To:Cc:In-Reply-To:Subject:From; b=ublhSAQDfCwb+ghSgU3YgQV3w6NZu09ESNpBsU4L4v9oE6jFZWe11RZADe4reo5gu +lEP/1RzSRi7YebF6KVCpINLdYnFe4dHbhyslClKQcNnxbmos6IHTHlnZ0wt8rcvk2 y3IN0AoX5BymwwBJuv+KcXJ4S+NJeruzWs9GED+JnSok2qNE1buS4qEESm9BdL4ltO VKl+Ui3pfv0SBQ3Pizr2M8qAyRq5qI3UTv2Dzy2IXHUgpjvpjcs047WvcSXhIB24Fl CwxVqcHb4dyM9miWgZzEoB+7JrgAvXPEloBqNH8ChyBngqG0/MydFq8Wk5jNsrAnMT +a7C/pC3bB7lQ== In-Reply-To: X-Originating-IP: [193.240.154.120] X-Mailer: Zimbra 7.2.0-GA2598 (ZimbraWebClient - NAV6 (Win)/7.2.0-GA2598) X-Authenticated-User: jeberger@free.fr X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:256974 Archived-At: Jo=C3=A3o T=C3=A1vora gmail.com> writes: > On Tue, Feb 28, 2023 at 1:59=E2=80=AFPM wrote: >=20 > > > This works, and this would explain the instability I saw earlier. > > > Thanks. I wonder if it fixes Jer=C3=B4me'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. >=20 > It may seem logical to you but since you didn't state this in your > original recipe, it's only logical that I wondered. >=20 > For me, a change to a variable should take effect immediately, > no reboots or restarts. If you're satisfied with less, suit yourself > (maybe you're on M$ windows?). >=20 My main platform is Linux, I only use W$ at work because I have to. But on either platform, I don't expect changes to the environment to be=20 picked by child processes or connections that were started before the change. > > 1. When told that the language server is `rust-analyzer`, Eglot > > fails > Patches welcome. Patches that remove code and don't break anything > even more welcome. The patch you sent is insufficient, by your own > admission. And Eli didn't like it either. >=20 Here you go: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D8<------------------------------ --- a/eglot.el 2023-02-28 15:38:01.161316788 +0100 +++ b/eglot.el 2023-02-28 15:38:57.445653435 +0100 @@ -1156,10 +1156,11 @@ ;; ;; Not only does this seem like there should be a better way, ;; but it almost certainly doesn=E2=80=99t work on non-unix systems. - (list "sh" "-c" - (string-join (cons "stty raw > /dev/null;" - (mapcar #'shell-quote-argument contact)) - " ")) + (with-connection-local-variables + (list shell-file-name shell-command-switch + (string-join (cons "stty raw > /dev/null;" + (mapcar #'shell-quote-argument contact)) + " "))) contact)) (defvar-local eglot--cached-server nil ------------------------------>8=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Note that: - I said it was insufficient because it only fixed point 1 not point 2, but that doesn't mean it's not worthwhile (see below for point 2). - Eli didn't like it due to a doubt about the behaviour of `shell-file-name` for remote connections, but Michael has confirmed that this use is correct. > > 2. Eglot doesn't detect `rust-analyzer` automatically.=20 >=20 > Eglot uses (executable-find "rust-analyzer" t). The second argument > asks to consider the remote path, but sometimes that path, which is > configured by tramp-remote-path isn't considered immediately. Michael > clarified this and I expressed the opinion that it is shortcoming > of Tramp. >=20 Effectively, `(executable-find "rust-analyzer" t)` doesn't find it. I'll try to find out why, but this point should indeed be fixed in `executable-find` rather than Eglot. J=C3=A9r=C3=B4me