]> git.eshelyaron.com Git - emacs.git/commitdiff
(tar-copy): Inhibit use of jka-compr handler
authorRichard M. Stallman <rms@gnu.org>
Tue, 25 Jul 1995 20:27:07 +0000 (20:27 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 25 Jul 1995 20:27:07 +0000 (20:27 +0000)
when both to- and from- files would use it.

lisp/tar-mode.el

index dfc555c97e94f409a0022b76aa68cc45834b5ae7..e0cdf304b720c53596fc8e631b5f8dc00d4a374b 100644 (file)
@@ -789,9 +789,20 @@ the current tar-entry."
         (name (tar-header-name tokens))
         (size (tar-header-size tokens))
         (start (+ (tar-desc-data-start descriptor) tar-header-offset -1))
-        (end (+ start size)))
+        (end (+ start size))
+        (inhibit-file-name-handlers inhibit-file-name-handlers)
+        (inhibit-file-name-operation inhibit-file-name-operation))
     (save-restriction
       (widen)
+      ;; Inhibit compressing a subfile again if *both* name and
+      ;; to-file are handled by jka-compr
+      (if (and (eq (find-file-name-handler name 'write-region) 'jka-compr-handler)
+              (eq (find-file-name-handler to-file 'write-region) 'jka-compr-handler))
+         (setq inhibit-file-name-handlers
+               (cons 'jka-compr-handler
+                     (and (eq inhibit-file-name-operation 'write-region)
+                          inhibit-file-name-handlers))
+               inhibit-file-name-operation 'write-region))
       (write-region start end to-file))
     (message "Copied tar entry %s to %s" name to-file)))