From: Felix Dietrich Date: Thu, 7 Apr 2022 10:04:22 +0000 (+0200) Subject: Fix error in tramp-archive-autoload-file-name-handler X-Git-Tag: emacs-28.1.90~156 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=aab36e18950e23100718eaedb14ef9176f5d3da2;p=emacs.git 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 --- 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)