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.
This commit is contained in:
Michael Albinus 2023-10-23 17:07:17 +02:00
parent 79d8328ca4
commit 85d08d5788
2 changed files with 6 additions and 1 deletions

View file

@ -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 method) or @code{:user} (a remote user name). The @code{nil} criteria
matches all buffers with a remote default directory. 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 @node Key Bindings
@section Customizing Key Bindings @section Customizing Key Bindings
@cindex key bindings @cindex key bindings

View file

@ -644,7 +644,8 @@ Return a reordered plist."
"Return the connection profiles list for CRITERIA. "Return the connection profiles list for CRITERIA.
CRITERIA is a plist identifying a connection and the application CRITERIA is a plist identifying a connection and the application
using this connection, see `connection-local-criteria-alist'." 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) (dolist (crit-alist connection-local-criteria-alist)
(let ((crit criteria) (let ((crit criteria)
(match t)) (match t))