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 16:28:11 +0000 Message-ID: References: <87sfeqq8z5.fsf@gmail.com> <75486564.6945596.1677592772065.JavaMail.root@zimbra60-e10.priv.proxad.net> <87r0u9devu.fsf@gmx.de> <87bkld6ctm.fsf@gmx.de> <87356p6b7g.fsf@gmx.de> 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="12151"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jeberger@free.fr, 61748@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 28 17:29:10 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 1pX2qj-00033T-4O for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Feb 2023 17:29:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pX2qf-0005jY-Mw; Tue, 28 Feb 2023 11:29: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 1pX2qd-0005iw-EI for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2023 11:29: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 1pX2qc-0004OT-BK for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2023 11:29:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pX2qb-0004zE-Qa for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2023 11:29:01 -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 16:29:01 +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.167760171219122 (code B ref 61748); Tue, 28 Feb 2023 16:29:01 +0000 Original-Received: (at 61748) by debbugs.gnu.org; 28 Feb 2023 16:28:32 +0000 Original-Received: from localhost ([127.0.0.1]:51877 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pX2q7-0004yM-TG for submit@debbugs.gnu.org; Tue, 28 Feb 2023 11:28:32 -0500 Original-Received: from mail-oi1-f171.google.com ([209.85.167.171]:43898) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pX2q5-0004y8-Nc for 61748@debbugs.gnu.org; Tue, 28 Feb 2023 11:28:30 -0500 Original-Received: by mail-oi1-f171.google.com with SMTP id bk32so8440505oib.10 for <61748@debbugs.gnu.org>; Tue, 28 Feb 2023 08:28:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677601702; 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=VVjbvQN2+EJOZjidVEPLET86VtGB8vPQwhJxaIRHwLg=; b=iYl4WIcMi2DnVT0+tn2mEAQofrKCd7khjMf7FMSpvYjLNjxlOgKgY/CHp4IPNLXWDI wM1rSE0XAKuIsbR4hpeayz5Mi0ryp0TSZl3T9NVLwiSOD4jBfSS2qrNx0PvT8IaZFaUp WYZw7HN5GVzd+MUheQd0p0V0mF75iAWvTRWxduvq6cSOB9UAqmWtXGofpTg9CjvjJ9Hj PsVZTtCp+awO4oadJX6sntZe2PkX3pzPe6O/ORcoLi5va4KSk/KZlMUzhCCEF6p+PT6X oBrJDgBXN0Yzjcn326cbfLNsA+PSwcZ0S4ah1kfxa79IEoah2HxUFJL14N+BQgqjFCvr vsTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677601702; 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=VVjbvQN2+EJOZjidVEPLET86VtGB8vPQwhJxaIRHwLg=; b=TRLqdD5qLYyBNg+/YWvcNLtk3LlV4oTyzATY7vTTCsCAXVtIMrt7vbuozoGm2+TH45 MtPCx+Z26H1yAni8zDOmO3RRIb0SaZqMKjfNGXrq9/gx5Mlywt0CTdNh8+4SEKD7Dj+q +3v+G7sCyhaOX6Uzs4GZfT7ftVS1Ex22m6njnd1fD0EIDQHTdpFR4Y0vQE2uNnfePydH Sqkmy+pA8PVnKfrikMueV/3j/UNiVYzmVvqwxJYxjWbcVcHhReCGFZdJvljXdoFn3G8f +qUh3dOTynKTj5ORtShpyuuU1ed6etR4449eyBLL/Yo5viSALMdx9+1E5Efqn58Os397 54Rw== X-Gm-Message-State: AO0yUKXHtxfECoBAMhsy5NFHMrPuptjM+NDGQ3RumRzzmjU65BZOuQMW PDhG4z/NmOC9EK8Toq1Yd09ugtG/X8WYFXFm13U= X-Google-Smtp-Source: AK7set/RGyM03lUgiXC7f/J028/7Z/z404BAfrd/4CozV2vAtp1ztf5AH2a84jMX1fLI0mqYbE83C/qBDxObUT0Zd3A= X-Received: by 2002:a05:6808:2799:b0:36e:f6f5:66a2 with SMTP id es25-20020a056808279900b0036ef6f566a2mr1196160oib.8.1677601702710; Tue, 28 Feb 2023 08:28:22 -0800 (PST) In-Reply-To: <87356p6b7g.fsf@gmx.de> 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:256990 Archived-At: On Tue, Feb 28, 2023 at 3:50=E2=80=AFPM Michael Albinus wrote: > > Jo=C3=A3o T=C3=A1vora writes: > > Hi Jo=C3=A3o, > > >> I don't expect a user to solve it. And a user shouldn't expect that > >> changing a variable is sufficient. > > > > I respectfully but diametrically disagree here. > > > > Here's an untested patch that could solve this. It can probably > > be made smarter by only invalidating the cache when a change > > to the variable is detected. > > Hmm. It will delay startup of remote processes, if tramp-remote-path > doesn't change for different processes. Perhaps it is negligable, but at > least for slow connections people will be hit by this. > > I'll play with it. Perhaps there is a smarter version of it, as you say. Here's another still untested but smarter patch. Caches fully on until user messes with tramp-remote-path, else immediately flushed. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 56436d32970..335d718b139 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -2316,10 +2316,7 @@ Remote programs @end lisp When remote search paths are changed, local @value{tramp} caches must -be recomputed. To force @value{tramp} to recompute afresh, call -@kbd{M-x tramp-cleanup-this-connection @key{RET}} or friends -(@pxref{Cleanup remote connections}). - +be recomputed, but not by the user, so don't worry about this. @node Remote shell setup @section Remote shell setup hints diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index ec8437176db..ef618855584 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -5571,10 +5571,18 @@ tramp-check-remote-uname "Check whether REGEXP matches the connection property \"uname\"." (string-match-p regexp (tramp-get-connection-property vec "uname" ""))) +(defvar tramp-last-used-remote-path nil) + (defun tramp-get-remote-path (vec) "Compile list of remote directories for PATH. Nonexistent directories are removed from spec." (with-current-buffer (tramp-get-connection-buffer vec) + (when (not (equal tramp-last-used-remote-path tramp-remote-path)) + ;; If user has tweaked `tramp-remote-path', flush any caches + ;; bug#61748. + (dolist (v (list vec (tramp-get-process vec))) + (tramp-flush-connection-property v "remote-path"))) + (setq tramp-last-used-remote-path tramp-remote-path)) ;; Expand connection-local variables. (tramp-set-connection-local-variables vec) (with-tramp-connection-property