summaryrefslogtreecommitdiff
path: root/lisp/files-x.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2022-02-07 19:32:38 +0100
committerMichael Albinus <michael.albinus@gmx.de>2022-02-07 19:32:38 +0100
commit992908b09a4f95817bbd548fd577d7573ad9cd2d (patch)
tree7ffd699315c5569880d2b1ac78375afda9025f27 /lisp/files-x.el
parent9338fbbc2803ec59cd24e08a02db800f2fc2aabf (diff)
downloademacs-992908b09a4f95817bbd548fd577d7573ad9cd2d.tar.gz
Make connection-local variables user options
* lisp/files-x.el (connection-local-profile-alist) (connection-local-criteria-alist): Make them user options. * doc/lispref/variables.texi (Connection Local Variables): * etc/NEWS: Document this.
Diffstat (limited to 'lisp/files-x.el')
-rw-r--r--lisp/files-x.el29
1 files changed, 24 insertions, 5 deletions
diff --git a/lisp/files-x.el b/lisp/files-x.el
index e86ba8f8d04..773339d748a 100644
--- a/lisp/files-x.el
+++ b/lisp/files-x.el
@@ -579,15 +579,22 @@ changed by the user.")
(setq ignored-local-variables
(cons 'connection-local-variables-alist ignored-local-variables))
-(defvar connection-local-profile-alist nil
+(defcustom connection-local-profile-alist nil
"Alist mapping connection profiles to variable lists.
Each element in this list has the form (PROFILE VARIABLES).
PROFILE is the name of a connection profile (a symbol).
VARIABLES is a list that declares connection-local variables for
PROFILE. An element in VARIABLES is an alist whose elements are
-of the form (VAR . VALUE).")
-
-(defvar connection-local-criteria-alist nil
+of the form (VAR . VALUE)."
+ :type '(repeat (cons (symbol :tag "Profile")
+ (repeat :tag "Variables"
+ (cons (symbol :tag "Variable")
+ (sexp :tag "Value")))))
+ :group 'files
+ :group 'tramp
+ :version "29.1")
+
+(defcustom connection-local-criteria-alist nil
"Alist mapping connection criteria to connection profiles.
Each element in this list has the form (CRITERIA PROFILES).
CRITERIA is a plist identifying a connection and the application
@@ -596,7 +603,19 @@ using this connection. Property names might be `:application',
`:application' is a symbol, all other property values are
strings. All properties are optional; if CRITERIA is nil, it
always applies.
-PROFILES is a list of connection profiles (symbols).")
+PROFILES is a list of connection profiles (symbols)."
+ :type '(repeat (cons (plist :tag "Criteria"
+ ;; Give the most common options as checkboxes.
+ :options (((const :format "%v " :application)
+ symbol)
+ ((const :format "%v " :protocol) string)
+ ((const :format "%v " :user) string)
+ ((const :format "%v " :machine) string)))
+ (repeat :tag "Profiles"
+ (symbol :tag "Profile"))))
+ :group 'files
+ :group 'tramp
+ :version "29.1")
(defsubst connection-local-normalize-criteria (criteria)
"Normalize plist CRITERIA according to properties.