emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master f692deb 1/2: * lisp/net/tramp-archive.el (tramp-arc


From: Michael Albinus
Subject: [Emacs-diffs] master f692deb 1/2: * lisp/net/tramp-archive.el (tramp-archive-run-real-handler): New defun.
Date: Thu, 1 Feb 2018 02:53:21 -0500 (EST)

branch: master
commit f692deb7ddbb5b0af51ad1aef594477f2669a583
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    * lisp/net/tramp-archive.el (tramp-archive-run-real-handler): New defun.
    
    (tramp-archive-file-name-handler): Use it.
---
 lisp/net/tramp-archive.el | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el
index 8d292e1..241bb29 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.")
   (cl-letf (((symbol-function 'tramp-tramp-file-p) 'tramp-archive-file-name-p))
     (apply 'tramp-file-name-for-operation operation args)))
 
+(defun tramp-archive-run-real-handler (operation args)
+  "Invoke normal file name handler for OPERATION.
+First arg specifies the OPERATION, second arg is a list of arguments to
+pass to the OPERATION."
+  (let* ((inhibit-file-name-handlers
+         `(tramp-archive-file-name-handler
+           .
+           ,(and (eq inhibit-file-name-operation operation)
+                 inhibit-file-name-handlers)))
+        (inhibit-file-name-operation operation))
+    (apply operation args)))
+
 ;;;###tramp-autoload
 (defun tramp-archive-file-name-handler (operation &rest args)
   "Invoke the GVFS archive related OPERATION.
@@ -267,8 +279,9 @@ pass to the OPERATION."
                          operation args))
         (archive (tramp-archive-file-name-archive filename)))
     ;; The file archive could be a directory, see Bug#30293.
-    (if (file-directory-p archive)
-       (tramp-run-real-handler operation args)
+    (if (and archive
+            (tramp-archive-run-real-handler 'file-directory-p (list archive)))
+       (tramp-archive-run-real-handler operation args)
       ;; Now run the handler.
       (unless tramp-gvfs-enabled
        (tramp-compat-user-error nil "Package `tramp-archive' not supported"))
@@ -279,7 +292,7 @@ pass to the OPERATION."
          (setq args (cons operation args)))
        (if fn
            (save-match-data (apply (cdr fn) args))
-         (tramp-run-real-handler operation args))))))
+         (tramp-archive-run-real-handler operation args))))))
 
 ;; Mark `operations' the handler is responsible for.
 (put 'tramp-archive-file-name-handler 'operations



reply via email to

[Prev in Thread] Current Thread [Next in Thread]