aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2018-02-01 08:40:46 +0100
committerMichael Albinus2018-02-01 08:40:46 +0100
commitf692deb7ddbb5b0af51ad1aef594477f2669a583 (patch)
treee4cc11fc995da4d8f62ff76cb209c20aa6550b5d
parent1a04d95266af94f578e9d96676e6adc44c602306 (diff)
downloademacs-f692deb7ddbb5b0af51ad1aef594477f2669a583.tar.gz
emacs-f692deb7ddbb5b0af51ad1aef594477f2669a583.zip
* lisp/net/tramp-archive.el (tramp-archive-run-real-handler): New defun.
(tramp-archive-file-name-handler): Use it.
-rw-r--r--lisp/net/tramp-archive.el19
1 files changed, 16 insertions, 3 deletions
diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el
index 8d292e16023..241bb29759d 100644
--- a/lisp/net/tramp-archive.el
+++ b/lisp/net/tramp-archive.el
@@ -258,6 +258,18 @@ Operations not mentioned here will be handled by the default Emacs primitives.")
258 (cl-letf (((symbol-function 'tramp-tramp-file-p) 'tramp-archive-file-name-p)) 258 (cl-letf (((symbol-function 'tramp-tramp-file-p) 'tramp-archive-file-name-p))
259 (apply 'tramp-file-name-for-operation operation args))) 259 (apply 'tramp-file-name-for-operation operation args)))
260 260
261(defun tramp-archive-run-real-handler (operation args)
262 "Invoke normal file name handler for OPERATION.
263First arg specifies the OPERATION, second arg is a list of arguments to
264pass to the OPERATION."
265 (let* ((inhibit-file-name-handlers
266 `(tramp-archive-file-name-handler
267 .
268 ,(and (eq inhibit-file-name-operation operation)
269 inhibit-file-name-handlers)))
270 (inhibit-file-name-operation operation))
271 (apply operation args)))
272
261;;;###tramp-autoload 273;;;###tramp-autoload
262(defun tramp-archive-file-name-handler (operation &rest args) 274(defun tramp-archive-file-name-handler (operation &rest args)
263 "Invoke the GVFS archive related OPERATION. 275 "Invoke the GVFS archive related OPERATION.
@@ -267,8 +279,9 @@ pass to the OPERATION."
267 operation args)) 279 operation args))
268 (archive (tramp-archive-file-name-archive filename))) 280 (archive (tramp-archive-file-name-archive filename)))
269 ;; The file archive could be a directory, see Bug#30293. 281 ;; The file archive could be a directory, see Bug#30293.
270 (if (file-directory-p archive) 282 (if (and archive
271 (tramp-run-real-handler operation args) 283 (tramp-archive-run-real-handler 'file-directory-p (list archive)))
284 (tramp-archive-run-real-handler operation args)
272 ;; Now run the handler. 285 ;; Now run the handler.
273 (unless tramp-gvfs-enabled 286 (unless tramp-gvfs-enabled
274 (tramp-compat-user-error nil "Package `tramp-archive' not supported")) 287 (tramp-compat-user-error nil "Package `tramp-archive' not supported"))
@@ -279,7 +292,7 @@ pass to the OPERATION."
279 (setq args (cons operation args))) 292 (setq args (cons operation args)))
280 (if fn 293 (if fn
281 (save-match-data (apply (cdr fn) args)) 294 (save-match-data (apply (cdr fn) args))
282 (tramp-run-real-handler operation args)))))) 295 (tramp-archive-run-real-handler operation args))))))
283 296
284;; Mark `operations' the handler is responsible for. 297;; Mark `operations' the handler is responsible for.
285(put 'tramp-archive-file-name-handler 'operations 298(put 'tramp-archive-file-name-handler 'operations