From aab36e18950e23100718eaedb14ef9176f5d3da2 Mon Sep 17 00:00:00 2001 From: Felix Dietrich Date: Thu, 7 Apr 2022 12:04:22 +0200 Subject: [PATCH] Fix error in tramp-archive-autoload-file-name-handler MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * 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 --- lisp/net/tramp-archive.el | 15 +++++++-------- 1 file 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) -- 2.39.5