From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#54459: 29.0.50; Simplify connection-local variables (feature request) Date: Sun, 20 Mar 2022 13:09:55 +0100 Message-ID: <20220320120955.54fc67ohdot35aln@Ergus> References: <87bky2zjzz.fsf.ref@aol.com> <87bky2zjzz.fsf@aol.com> <87fsncdgw3.fsf@gmx.de> Reply-To: Ergus Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8840"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 54459@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 20 13:11:52 2022 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 1nVuPY-00026L-D5 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 20 Mar 2022 13:11:52 +0100 Original-Received: from localhost ([::1]:54202 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVuPV-0002Th-3b for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 20 Mar 2022 08:11:50 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48714) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVuOk-0002RK-V8 for bug-gnu-emacs@gnu.org; Sun, 20 Mar 2022 08:11:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39151) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nVuOk-0003h8-Jm for bug-gnu-emacs@gnu.org; Sun, 20 Mar 2022 08:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nVuOk-0005kC-FP for bug-gnu-emacs@gnu.org; Sun, 20 Mar 2022 08:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ergus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Mar 2022 12:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54459 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: 54459@debbugs.gnu.org, "Ergus via Bug reports for GNU Emacs, the Swiss army knife of text editors" Original-Received: via spool by submit@debbugs.gnu.org id=B.164777825022062 (code B ref -1); Sun, 20 Mar 2022 12:11:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Mar 2022 12:10:50 +0000 Original-Received: from localhost ([127.0.0.1]:33048 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVuOX-0005jl-Ph for submit@debbugs.gnu.org; Sun, 20 Mar 2022 08:10:50 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:59754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVuOV-0005jd-Q4 for submit@debbugs.gnu.org; Sun, 20 Mar 2022 08:10:48 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVuOT-0002Nf-JS for bug-gnu-emacs@gnu.org; Sun, 20 Mar 2022 08:10:47 -0400 Original-Received: from sonic301-2.consmr.mail.bf2.yahoo.com ([74.6.129.41]:44968) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nVuOQ-0003ea-Hx for bug-gnu-emacs@gnu.org; Sun, 20 Mar 2022 08:10:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1647778239; bh=S9VRL5Npgv1d1SGeymfZFwCyGDP5W0nbCA8dCaBl8hI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject:Reply-To; b=AQjc8B4hV2ecPRopNPv26+WWs5DjApH2BAD6VjpU1uRpHKf8A6IUrBMfL8HlRRzf1G+qsiShFPlKfaHIkrHmXCecqyKT3HkYiBQto/4DFpBofSbJRT/AKxZN7L4YtsyoDlZh0HKNBqeNSL9P8C3bM9QM7CKKNZVj30mDZJnqpixKBdg7s2nFglA5+YEb6ttbD+lw+I5lRactjqNtS6Z99DvfHbHpYQK5sIQ/DLAiy+mYHkWCua433DbeqQX6BlXIsO0tRUF0I9kAy90X7gf51dUGyl4UQ5GI6/xeeP+EOYL3ZepNpng5TUA/T53fQWTlPEZS2yZJ2j/5NcM54vadaA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1647778239; bh=cSlp9uiIaJaKQL3uKxKCZYIDknrmcerg9ZM5Jtr7aeM=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=ARVTcyzETgvxmKhX3RJBp3kJlkr3Qwzn45kB9nw0bvfnEW5Qi4+Sx7QJRnSwMmSTVQXOvxCnmYpHaGfDq94cifqwR7TipuJ+lV4wqV8zbo637p+I9BZZP+UeFadL0t1HRvVasnXoGl8ahO71KpQXZcfe1m81ZMA7RhAgrizv9FhkzTVwOLSi6Xi/rlyTLnvihaEfspAYGhQ6MHxtEE1pO5ncJ5BPiCO3n8DPPe9PFTlSRu3O6B5FYqIypb3gJcwDAJUGvIvF+MOBSs84JO0uv9Jg5wAzh5S28wC+M1WVROWtJt4hITlVxXbP1Bn+k0DhAM4gYgAk9AWbb5u9vKiyeQ== X-YMail-OSG: IdQ8UucVM1kZNbhvidJFwlnKZa0QrHE.XlWmBdQjc4hN4JeMWsEaBclKfhQgIBV RTAy0xoUaLSXhuYWFElJJDqkTll8bAEL4_icePDXGVfcH1gmGW_0.hL0NmeDMYyLjNrAYlgO1Ruz iNZXanc7XvM1JdwG2bVo4EBRGQnBIbMAzcdTF2x9Hp2Z3DCrs7wX40EJiSse0hRjBTEeqM6_86qO 2FsXrWjOaJvFJIMLYv6E1c8ToR8UFgFTMrKjKy_jW9rmVAptox7WqGJvGosoarVvp4WOR0DqxGWL nNfrOVMXALS9NBKeVPPxzKOUo444Ln5u3g8M2kyQcluA9E6m8ZrgV4qzhjXqET9phz20mLkIoyvY nRa_n2ss7VZkSPNiwhqMjVI6fHpgJrK99FsFP0lwpDTCv_Ykqx5edGR7_GhAwIgl63kBFvrpxo0m _xMPCRv90DLNS3jjBQqLKVA5h8AgKpHYVjvNQDYktps5bVLmDhxeg0j81otgM_RKuY41z7Ttxckl .eU56gV_nuWSaD2Eywpep_RiPA_fW9uGg0XW_sii6yO0oB_CCJvsFlFHjeAl4tTCqu1CAFeWE.U9 GAMpoCrX99XZuuyRD2PI39BxD0ZUlFPNSg.Fxtp57hOtr3MtSkQpbOtf6mtbHencRhKRNIJPwBxD aEjxaoma6naXlkM7wk3cQoojcTMiOi35W_Rwzt4WnC7iS7RfTZlk4dCcEltIg6bnioYjpXkf1_CG O2NUFjzDQGQjMIxlfEVxL.fvNAZjW_7aJF2GnKUvcEHaJGkzZ8VLEYQ1AyTzbujKEyyv.GBTTvJ5 6Pfw7Rl4_6fFQV_0wwte0es7G8iYpwT463gO6Q0nfY X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.bf2.yahoo.com with HTTP; Sun, 20 Mar 2022 12:10:39 +0000 Original-Received: by kubenode515.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 1f0bad5c3c4fa8ff9e26327031ca0bd0; Sun, 20 Mar 2022 12:10:35 +0000 (UTC) Content-Disposition: inline In-Reply-To: <87fsncdgw3.fsf@gmx.de> X-Mailer: WebService/1.1.19894 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol Received-SPF: pass client-ip=74.6.129.41; envelope-from=spacibba@aol.com; helo=sonic301-2.consmr.mail.bf2.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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" Xref: news.gmane.io gmane.emacs.bugs:228619 Archived-At: On Sun, Mar 20, 2022 at 12:04:28PM +0100, Michael Albinus wrote: >Ergus via "Bug reports for GNU Emacs, the Swiss army knife of text >editors" writes: > >> Hi: > >Hi, > >> There are 3 issues that could be solved/improved: >> >> 1) If another buffer of a file in the same remote host is already open, >> then when the function is called in that buffer for the first time it >> will use the value cached in gtags--executable-connection. That's why in >> the code I need to create a buffer local variable... Could we provide a >> way to update all of them immediately? > >I don't understand the scenario, sorry. Could you pls explain it in detail? > Suppose: C-x C-f /ssh:myhost:file1 C-x C-f /ssh:myhost:file2 (executable-find mycommand 1) And here we set the connection local variable... When we go to file1 if does not know about the variable in spite of it is in the same host. >> 2) There are functions to set connection-local profile variables >> (connection-local-set-profile-variables) But so far there are not any >> clean way to append variables to an existing profile; so a call to >> connection-local-set-profile-variables deleted any previous variable, >> actually the user is enforced to create a unique name for every profile >> every time it needs something like this. > >--8<---------------cut here---------------start------------->8--- >(connection-local-set-profile-variables > 'profile > (append > (connection-local-get-profile-variables 'profile) > my-variables-list)) >--8<---------------cut here---------------end--------------->8--- > Could you consider to add a snippet in the documentation explaining this? Please? >> 3) In the ideal world it may be possible to add an optional parameter to >> tell executable-find to cache the found values per host and executable >> name... so it could avoid the extra remote search... I understand this >> shouldn't be enabled by default, but many packages may find it >> useful. executable-find could be smart enough to remember some of the >> previous searches at least in remote hosts. > >That's hard to do. A user could change the remote PATH while the result >of executable-find is cached. Furthermore, Tramp appends the local part >of the remote default-directory to the directory search list. SO this means that the executable in default-directory are also considered? Like on Windows? I was not aware of that... >Therefore, >executable-find could return a possibly wrong cached value. > >You could write your own function, using Tramp's cache mechanism, but at >your own risk. Something like (untested) > >--8<---------------cut here---------------start------------->8--- >(defun my-executable-find (command &optional remote) > (if (and remote (file-remote-p default-directory)) > (with-tramp-connection-property > (tramp-get-process (tramp-dissect-file-name default-directory)) > (concat "executable-find-" command) > (executable-find command remote)) > (executable-find command remote))) >--8<---------------cut here---------------end--------------->8--- > I was thinking in something like: (executable-find command &optional remote cache) but basically the same idea. But it was just a dream... A man can dream, a man can dream ;p >Best regards, Michael. Thanks, Ergus