From 85d08d5788eba1e7195f6ea8888e802aea87f19d Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 23 Oct 2023 17:07:17 +0200 Subject: [PATCH] Minor connection-local variables fixes * doc/emacs/custom.texi (Connection Variables): Warn about specifying the same variable twice. * lisp/files-x.el (connection-local-get-profiles): Normalize criteria. --- doc/emacs/custom.texi | 4 ++++ lisp/files-x.el | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index 09473d7deb7..2bc39095f3c 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -1572,6 +1572,10 @@ discriminate for the properties @code{:protocol} (this is the Tramp method) or @code{:user} (a remote user name). The @code{nil} criteria matches all buffers with a remote default directory. + Be careful when declaring different profiles with the same variable, +and setting these profiles to criteria which could match in parallel. +It is unspecified which variable value is used then. + @node Key Bindings @section Customizing Key Bindings @cindex key bindings diff --git a/lisp/files-x.el b/lisp/files-x.el index 9b1a7a17902..477ca059b2a 100644 --- a/lisp/files-x.el +++ b/lisp/files-x.el @@ -644,7 +644,8 @@ Return a reordered plist." "Return the connection profiles list for CRITERIA. CRITERIA is a plist identifying a connection and the application using this connection, see `connection-local-criteria-alist'." - (let (profiles) + (let ((criteria (connection-local-normalize-criteria criteria)) + profiles) (dolist (crit-alist connection-local-criteria-alist) (let ((crit criteria) (match t)) -- 2.39.2