tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question for Per-Connection Local Variables


From: Fredrik Salomonsson
Subject: Question for Per-Connection Local Variables
Date: Sat, 03 Jul 2021 01:48:47 +0000

Hi,

I'm trying to use Per-Connection Local Variables [0] to setup a profile
for machines I connect to at work. I followed the steps described in the
TRAMP manual [1] and the emacs manual [0].

[0] 
https://www.gnu.org/software/emacs/manual/html_node/emacs/Connection-Variables.html
[1] 
https://www.gnu.org/software/emacs/manual/html_node/tramp/Remote-programs.html

I didn't get it to work if I tried with a regexp, but if I specified the
name of one host it worked for that host.

>From what I can gather, TRAMP is just using
connection-local-get-profiles to fetch the profiles and that function is
just using equal to compare the values. I could be wrong though.

Here is a simplified elisp snippet of what I want to do:

(connection-local-set-profile-variables
 'remote-bash
 '((shell-file-name . "/bin/bash")))

(connection-local-set-profiles
            '(:application 'tramp :protocol "ssh" :machine ".*\\.work")
            'remote-bash)

And if I use:
(connection-local-get-profiles
   '(:application 'tramp :protocol "ssh" :machine ".*\\.work"))

I get (remote-bash)

But: 
(connection-local-get-profiles 
  '(:application 'tramp :protocol "ssh" :machine "foo.work"))

Return nil

Which is matching the behavior I see when using tramp.

Am I using the Per-Connection local variables correctly? Feels like I'm
missing something obvious here.

I've tested this snippet with emacs -Q, using:
GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo 
version 1.16.0)
GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo 
version 1.16.0)

Both gives the same result.

I've only tested the actual TRAMP setup with emacs 28.0.50 using TRAMP
2.5.1-pre.

Apologies in advance if I sent this to the wrong mailing list. I was
debating with myself if i should send this here or
to help-gnu-emacs@gnu.org. But given that this is mostly about TRAMP
I'll start here.

Thanks.

-- 
s/Fred[re]+i[ck]+/Fredrik/g



reply via email to

[Prev in Thread] Current Thread [Next in Thread]