From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= 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 14:25:45 +0000 Message-ID: References: <87sfeqq8z5.fsf@gmail.com> <75486564.6945596.1677592772065.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="13907"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Michael Albinus , 61748@debbugs.gnu.org To: jeberger@free.fr Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 28 15:27:18 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 1pX0wo-0003VO-Ee for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Feb 2023 15:27:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pX0wb-000052-5r; Tue, 28 Feb 2023 09:27:05 -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 1pX0wa-0008Vw-25 for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2023 09:27:04 -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 1pX0wY-0004c7-KW for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2023 09:27:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pX0wY-0001Bb-Gd for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2023 09:27:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Feb 2023 14:27: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.16775943654483 (code B ref 61748); Tue, 28 Feb 2023 14:27:02 +0000 Original-Received: (at 61748) by debbugs.gnu.org; 28 Feb 2023 14:26:05 +0000 Original-Received: from localhost ([127.0.0.1]:50005 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pX0vd-0001AF-1n for submit@debbugs.gnu.org; Tue, 28 Feb 2023 09:26:05 -0500 Original-Received: from mail-oa1-f44.google.com ([209.85.160.44]:38611) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pX0va-00019v-I5 for 61748@debbugs.gnu.org; Tue, 28 Feb 2023 09:26:03 -0500 Original-Received: by mail-oa1-f44.google.com with SMTP id 586e51a60fabf-1720433ba75so11067421fac.5 for <61748@debbugs.gnu.org>; Tue, 28 Feb 2023 06:26:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677594357; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=iZHkk2mnXDxx+4EpJo84mGX1iYCa3O/v6/R3kprEIfI=; b=PFhB7HKyDnENtJjx2rlxkmTBJAmPp2ewPkZH5iXdhbaJVPySpYKmZDDWHjrxRYKolj alQKL2kuL53DM423zcetmqhSoA28VAcloM4NNWIVS7xfnBmj1Tjd05PbP17O1ZTOZj6n tzkLvcDkQLyUFpK1Vp89/Bg5vGf+tMy34Bxuh6eoi/JajVi3H+ndK+WWyus4BywgGZ9v E3riQ0ArHnRuvk+OKVovTz57iRk4dy4SjvEByRXbVXUfzw29crK8KZnU2Umw+fwahm9M TWFyX4WcBTJImnjQY+rMfUVNJI+5U6JtZ3s5XXxxGAIcfo5U9U+GP+hXRrqJcKxGTvKT W4gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677594357; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iZHkk2mnXDxx+4EpJo84mGX1iYCa3O/v6/R3kprEIfI=; b=XCRY8QTDssWPZGe9kWbsiCHKqfw7vuEjdAWrWll7wUlMgRSWfxzfyb0aCjl4K7wlzj 8LS/EFBPO2DiftULvYTEAN0cw774yiDeHKVh3IIFf7DeGgML+Xx5GYZV87p5V9O7qHUY RkEdSDOYj7uMpr4hXaXTw97l5tzrCcg2LqH7TGR5P8TSNsOU4KT7Y6UKoeMirVi8mW+f 4ar9POTbueFJJvaEtp0CZyLraaFJxtHsbPzkAzfFhP/q181uUeTpdvZWacc9H9m1jxwS PE12BQHbO316gAnERuWe9nZoZaG2KN2dPz+c/GS+TvldlDaiMEePvFlM/u4ysPZbTQ6m MkNw== X-Gm-Message-State: AO0yUKW5Zc6yuWvpGBoXNIRfwrpMmG21bdQ/0ogXTRklLnc9lumRIEA+ Se6n215x73BFLxjJRkRBsiAZA3SIOCS6yqQW7vE= X-Google-Smtp-Source: AK7set/RSW93Bo7fWUszuShhbz9ONZs3ZQqLC0f50DLs3S48KqeQf247P6EdclophRGUShB/o9pz6PXf0DJlcRRo1GI= X-Received: by 2002:a05:6870:f80e:b0:169:ce1c:d7c2 with SMTP id fr14-20020a056870f80e00b00169ce1cd7c2mr5647466oab.5.1677594355972; Tue, 28 Feb 2023 06:25:55 -0800 (PST) In-Reply-To: <75486564.6945596.1677592772065.JavaMail.root@zimbra60-e10.priv.proxad.net> 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:256970 Archived-At: On Tue, Feb 28, 2023 at 1:59=E2=80=AFPM wrote: > > 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. It may seem logical to you but since you didn't state this in your original recipe, it's only logical that I wondered. 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?). > Just to be clear, which problem are we talking about here? The one that I described fully with a full reproduction recipe, a few messages ago. It seemed very similar to your problem, so I didn't think it was worth a separate bug report. > 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. 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. > 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. 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. Jo=C3=A3o