diff options
Diffstat (limited to 'lisp/net/tramp-archive.el')
-rw-r--r-- | lisp/net/tramp-archive.el | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el index 0bbd9271b18..67798e892ab 100644 --- a/lisp/net/tramp-archive.el +++ b/lisp/net/tramp-archive.el @@ -236,6 +236,7 @@ It must be supported by libarchive(3).") (file-exists-p . tramp-handle-file-exists-p) (file-in-directory-p . tramp-handle-file-in-directory-p) (file-local-copy . tramp-archive-handle-file-local-copy) + (file-locked-p . ignore) (file-modes . tramp-handle-file-modes) (file-name-all-completions . tramp-archive-handle-file-name-all-completions) ;; `file-name-as-directory' performed by default handler. @@ -262,9 +263,11 @@ It must be supported by libarchive(3).") (insert-directory . tramp-archive-handle-insert-directory) (insert-file-contents . tramp-archive-handle-insert-file-contents) (load . tramp-archive-handle-load) + (lock-file . ignore) (make-auto-save-file-name . ignore) (make-directory . tramp-archive-handle-not-implemented) (make-directory-internal . tramp-archive-handle-not-implemented) + (make-lock-file-name . ignore) (make-nearby-temp-file . tramp-handle-make-nearby-temp-file) (make-process . ignore) (make-symbolic-link . tramp-archive-handle-not-implemented) @@ -283,6 +286,7 @@ It must be supported by libarchive(3).") (tramp-get-remote-uid . ignore) (tramp-set-file-uid-gid . ignore) (unhandled-file-name-directory . ignore) + (unlock-file . ignore) (vc-registered . ignore) (verify-visited-file-modtime . tramp-handle-verify-visited-file-modtime) (write-region . tramp-archive-handle-not-implemented)) @@ -328,6 +332,8 @@ arguments to pass to the OPERATION." ;; `filename' could be a quoted file name. Or the file ;; archive could be a directory, see Bug#30293. (if (or (null archive) + (not (tramp-archive-run-real-handler + #'file-exists-p (list archive))) (tramp-archive-run-real-handler #'file-directory-p (list archive))) (tramp-archive-run-real-handler operation args) @@ -345,8 +351,17 @@ arguments to pass to the OPERATION." (tramp-archive-run-real-handler operation args))))))) ;;;###autoload -(defalias - 'tramp-archive-autoload-file-name-handler #'tramp-autoload-file-name-handler) +(progn (defun tramp-archive-autoload-file-name-handler (operation &rest args) + "Load Tramp archive file name handler, and perform OPERATION." + (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)) + tramp-archive-autoload ; Silence byte compiler. + (apply #'tramp-autoload-file-name-handler operation args))))) ;;;###autoload (progn (defun tramp-register-archive-file-name-handler () @@ -628,10 +643,8 @@ offered." (let ((result (insert-file-contents (tramp-archive-gvfs-file-name filename) visit beg end replace))) - (prog1 - (list (expand-file-name filename) - (cadr result)) - (when visit (setq buffer-file-name filename))))) + (when visit (setq buffer-file-name filename)) + (cons (expand-file-name filename) (cdr result)))) (defun tramp-archive-handle-load (file &optional noerror nomessage nosuffix must-suffix) |