>From 282fe5b2af1422236b213732d31a176fdea904ed Mon Sep 17 00:00:00 2001 From: Felix Dietrich Date: Mon, 4 Apr 2022 18:45:17 +0200 Subject: [PATCH] =?UTF-8?q?tramp-archive:=20Always=20call=20=E2=80=98tramp?= =?UTF-8?q?-autoload-file-name-handler=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise, not calling ‘tramp-autoload-file-name-handler’ in ‘tramp-archive-autoload-file-name-handler’ 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. --- 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 890c8dbb75..e7ffe2d4f4 100644 --- a/lisp/net/tramp-archive.el +++ b/lisp/net/tramp-archive.el @@ -360,14 +360,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.35.1