diff options
author | Felix Dietrich <felix.dietrich@sperrhaken.name> | 2022-04-07 12:04:22 +0200 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2022-04-07 12:04:22 +0200 |
commit | aab36e18950e23100718eaedb14ef9176f5d3da2 (patch) | |
tree | 00f7af5773b449a167fbb7dcb7023ab041c7d52a | |
parent | 11a1f7817e293f67fb0b1136859c2f7393c1adfb (diff) | |
download | emacs-aab36e18950e23100718eaedb14ef9176f5d3da2.tar.gz emacs-aab36e18950e23100718eaedb14ef9176f5d3da2.tar.bz2 emacs-aab36e18950e23100718eaedb14ef9176f5d3da2.zip |
Fix error in tramp-archive-autoload-file-name-handler
* lisp/net/tramp-archive.el (tramp-archive-autoload-file-name-handler):
Always call `tramp-autoload-file-name'. Otherwise, when
`tramp-archive-enabled’ is nil and
`tramp-archive-autoload-file-name-handler’ is in the
`file-name-handler-alist’ results in an error “Invalid handler in
`file-name-handler-alist” once Emacs calls
`tramp-archive-autoload-file-name-handler’ with a handler that
does not expect nil. Always returning nil is also false in
general.
Copyright-paperwork-exempt: yes
-rw-r--r-- | lisp/net/tramp-archive.el | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el index 22390ef45bc..4b649edaabd 100644 --- a/lisp/net/tramp-archive.el +++ b/lisp/net/tramp-archive.el @@ -356,14 +356,13 @@ arguments to pass to the OPERATION." (progn (defun tramp-archive-autoload-file-name-handler (operation &rest args) "Load Tramp archive file name handler, and perform OPERATION." (defvar tramp-archive-autoload) - (when tramp-archive-enabled - ;; We cannot use `tramp-compat-temporary-file-directory' here due - ;; to autoload. When installing Tramp's GNU ELPA package, there - ;; might be an older, incompatible version active. We try to - ;; overload this. - (let ((default-directory temporary-file-directory) - (tramp-archive-autoload t)) - (apply #'tramp-autoload-file-name-handler operation args))))) + (let (;; We cannot use `tramp-compat-temporary-file-directory' here + ;; due to autoload. When installing Tramp's GNU ELPA package, + ;; there might be an older, incompatible version active. We + ;; try to overload this. + (default-directory temporary-file-directory) + (tramp-archive-autoload tramp-archive-enabled)) + (apply #'tramp-autoload-file-name-handler operation args)))) (put #'tramp-archive-autoload-file-name-handler 'tramp-autoload t) |