unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: David Landell <david.landell@sunnyhill.email>
Cc: 54405@debbugs.gnu.org
Subject: bug#54405: 27.1; How to reset connection-local variable
Date: Fri, 18 Mar 2022 12:38:05 +0100	[thread overview]
Message-ID: <87h77vij8i.fsf@gmx.de> (raw)
In-Reply-To: <87lex7iv1n.fsf@gmx.de> (Michael Albinus's message of "Fri, 18 Mar 2022 08:23:00 +0100")

Michael Albinus <michael.albinus@gmx.de> writes:

Hi David,

>> So, seems I should use my own :application key but then I can't use
>> the resetting macro since that is not applying locals with a unique :application
>> key. There is something there with 'tramp' being applied by default that
>> I don't understand though.
>
> `with-connection-local-variables' calls
> `connection-local-criteria-for-default-directory' w/o an APPLICATION
> argument, that's why `tramp' is used by default. Perhaps we shall extend
> `with-connection-local-variables' to accept another :application
> key. But for the time being, you might copy
> `with-connection-local-variables' into your own package under another
> name, and modify it accordingly.

I've pushed a change to the Emacs master git branch, which allows to
change the application in `with-connection-local-variables'. The Elisp
manual has been extended with

--8<---------------cut here---------------start------------->8---
 -- Variable: connection-local-default-application
     The default application, a symbol, to be applied in
     ‘with-connection-local-variables’.  It defaults to ‘tramp’, but in
     case you want to overwrite Tramp’s settings temporarily, you could
     let-bind it like

          (connection-local-set-profile-variables
            'my-remote-perl
            '((perl-command-name . "/usr/local/bin/perl5")
              (perl-command-switch . "-e %s")))

          (connection-local-set-profiles
            '(:application 'my-app :protocol "ssh" :machine "remotehost")
            'my-remote-perl)

          (let ((default-directory "/ssh:remotehost:/working/dir/")
                (connection-local-default-application 'my-app))
            (with-connection-local-variables
              do something useful))

     This variable must not be changed globally.
--8<---------------cut here---------------end--------------->8---

Does this suffice?

>> /David

Best regards, Michael.





  reply	other threads:[~2022-03-18 11:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-15 20:44 bug#54405: 27.1; How to reset connection-local variable David Landell
2022-03-16 18:35 ` Michael Albinus
2022-03-17 15:02   ` David Landell
2022-03-18  7:23     ` Michael Albinus
2022-03-18 11:38       ` Michael Albinus [this message]
2022-03-18 16:57         ` David Landell
2022-03-19  8:24           ` Michael Albinus
2022-03-19 15:57             ` Drew Adams
2022-03-19 17:57               ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h77vij8i.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=54405@debbugs.gnu.org \
    --cc=david.landell@sunnyhill.email \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).