summaryrefslogtreecommitdiff
diff options
authorMichael Albinus <[email protected]>2025-10-26 12:40:10 +0100
committerMichael Albinus <[email protected]>2025-10-26 12:40:10 +0100
commite64ddb7ddf5cc00e59fbae5a6492422a5afcaf99 (patch)
tree9885b85bafb2ec6f11a2c2cce172159e8e35d1ae
parent98eb9fefbf3c92f97bc602e1444a180e09a9ba3f (diff)
downloadtramp-master.tar.gz
* tramp.el (tramp-add-external-operation): CheckHEADmaster
`default-directory' if `(car args)' is a relative file name, or nil.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/tramp.el6
2 files changed, 10 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 905da6ae..9ce5db00 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2025-10-26 Michael Albinus <[email protected]>
+
+ * tramp.el (tramp-add-external-operation): Check
+ `default-directory' if `(car args)' is a relative file name, or nil.
+
2025-10-25 Stephen Berman <[email protected]>
Fix Tramp support of GVFS built without FUSE
diff --git a/lisp/tramp.el b/lisp/tramp.el
index 261fbc11..7ef79092 100644
--- a/lisp/tramp.el
+++ b/lisp/tramp.el
@@ -927,6 +927,7 @@ Customize. See also `tramp-change-syntax'."
(const :tag "Ange-FTP" simplified)
(const :tag "XEmacs" separate))
:require 'tramp
+ ;; Starting we Emacs 31.1, we can use `custom-initialize-after-file' instead.
:initialize #'custom-initialize-default
:set #'tramp-set-syntax
:link '(info-link :tag "Tramp manual" "(tramp) Change file name syntax"))
@@ -970,6 +971,7 @@ to be set, depending on VALUE."
;; Initialize the Tramp syntax variables. We want to override initial
;; value of `tramp-file-name-regexp'. We do not call
;; `custom-set-variable', this would load Tramp via custom.el.
+;; Starting we Emacs 31.1, we can use `custom-initialize-after-file' instead.
(tramp--with-startup
(tramp-set-syntax 'tramp-syntax tramp-syntax))
@@ -2556,7 +2558,9 @@ packages like `tramp-sh' (except `tramp-ftp')."
`(lambda (orig-fun &rest args)
(if-let* ((handler
(find-file-name-handler
- (or (car args) default-directory) #',operation)))
+ (if (and (car args) (file-name-absolute-p (car args)))
+ (car args) default-directory)
+ #',operation)))
(apply handler #',operation args)
(apply orig-fun args)))
`((name . ,(concat "tramp-advice-" (symbol-name operation))))))))