diff options
Diffstat (limited to 'lisp/files-x.el')
-rw-r--r-- | lisp/files-x.el | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lisp/files-x.el b/lisp/files-x.el index 526a128623c..9e1954256a6 100644 --- a/lisp/files-x.el +++ b/lisp/files-x.el @@ -1,4 +1,4 @@ -;;; files-x.el --- extended file handling commands +;;; files-x.el --- extended file handling commands -*- lexical-binding: t; -*- ;; Copyright (C) 2009-2021 Free Software Foundation, Inc. @@ -602,7 +602,7 @@ PROFILES is a list of connection profiles (symbols).") "Normalize plist CRITERIA according to properties. Return a reordered plist." (apply - 'append + #'append (mapcar (lambda (property) (when (and (plist-member criteria property) (plist-get criteria property)) @@ -699,13 +699,14 @@ will not be changed." (copy-tree connection-local-variables-alist))) (hack-local-variables-apply))) -(defsubst connection-local-criteria-for-default-directory () - "Return a connection-local criteria, which represents `default-directory'." +(defsubst connection-local-criteria-for-default-directory (&optional application) + "Return a connection-local criteria, which represents `default-directory'. +If APPLICATION is nil, the symbol `tramp' is used." (when (file-remote-p default-directory) - `(:application tramp - :protocol ,(file-remote-p default-directory 'method) - :user ,(file-remote-p default-directory 'user) - :machine ,(file-remote-p default-directory 'host)))) + `(:application ,(or application 'tramp) + :protocol ,(file-remote-p default-directory 'method) + :user ,(file-remote-p default-directory 'user) + :machine ,(file-remote-p default-directory 'host)))) ;;;###autoload (defmacro with-connection-local-variables (&rest body) |