From 499f2085fa6fce6c7a2868c8d27d465f43d53f0f Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 18 Mar 2022 12:25:32 +0100 Subject: Make application configurable in 'with-connection-local-variables' * doc/lispref/variables.texi (Connection Local Variables): Explain 'connection-local-default-application'. * etc/NEWS: Mention 'connection-local-default-application'. * lisp/files-x.el (connection-local-default-application): New variable. (connection-local-criteria-for-default-directory): Use it. (Bug#54405) * test/lisp/files-x-tests.el (files-x-test-with-connection-local-variables): Extend test. --- test/lisp/files-x-tests.el | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/lisp/files-x-tests.el') diff --git a/test/lisp/files-x-tests.el b/test/lisp/files-x-tests.el index 60787e1cd3d..7ee2f0c1a65 100644 --- a/test/lisp/files-x-tests.el +++ b/test/lisp/files-x-tests.el @@ -325,6 +325,9 @@ (should-not (boundp 'remote-shell-file-name)) (should (string-equal (symbol-value 'remote-null-device) "null")) + (connection-local-set-profiles + files-x-test--application 'remote-bash) + (with-connection-local-variables ;; All connection-local variables are set. They apply in ;; reverse order in `connection-local-variables-alist'. @@ -344,6 +347,21 @@ (should (local-variable-p 'remote-shell-file-name)) (should (local-variable-p 'remote-null-device)) ;; The proper variable values are set. + (should + (string-equal (symbol-value 'remote-shell-file-name) "/bin/ksh")) + (should + (string-equal (symbol-value 'remote-null-device) "/dev/null")) + + ;; Run another instance of `with-connection-local-variables' + ;; with a different application. + (let ((connection-local-default-application (cadr files-x-test--application))) + (with-connection-local-variables + ;; The proper variable values are set. + (should + (string-equal (symbol-value 'remote-shell-file-name) "/bin/bash")) + (should + (string-equal (symbol-value 'remote-null-device) "/dev/null")))) + ;; The variable values are reset. (should (string-equal (symbol-value 'remote-shell-file-name) "/bin/ksh")) (should -- cgit v1.2.3