comparison lisp/tar-mode.el @ 12662:07ba0f6e9ada

(tar-copy): Inhibit use of jka-compr handler when both to- and from- files would use it.
author Richard M. Stallman <rms@gnu.org>
date Tue, 25 Jul 1995 20:27:07 +0000
parents d5a2fb3235ef
children 187735b53d52
comparison
equal deleted inserted replaced
12661:3c0fbefb3833 12662:07ba0f6e9ada
787 (let* ((descriptor (tar-get-descriptor)) 787 (let* ((descriptor (tar-get-descriptor))
788 (tokens (tar-desc-tokens descriptor)) 788 (tokens (tar-desc-tokens descriptor))
789 (name (tar-header-name tokens)) 789 (name (tar-header-name tokens))
790 (size (tar-header-size tokens)) 790 (size (tar-header-size tokens))
791 (start (+ (tar-desc-data-start descriptor) tar-header-offset -1)) 791 (start (+ (tar-desc-data-start descriptor) tar-header-offset -1))
792 (end (+ start size))) 792 (end (+ start size))
793 (inhibit-file-name-handlers inhibit-file-name-handlers)
794 (inhibit-file-name-operation inhibit-file-name-operation))
793 (save-restriction 795 (save-restriction
794 (widen) 796 (widen)
797 ;; Inhibit compressing a subfile again if *both* name and
798 ;; to-file are handled by jka-compr
799 (if (and (eq (find-file-name-handler name 'write-region) 'jka-compr-handler)
800 (eq (find-file-name-handler to-file 'write-region) 'jka-compr-handler))
801 (setq inhibit-file-name-handlers
802 (cons 'jka-compr-handler
803 (and (eq inhibit-file-name-operation 'write-region)
804 inhibit-file-name-handlers))
805 inhibit-file-name-operation 'write-region))
795 (write-region start end to-file)) 806 (write-region start end to-file))
796 (message "Copied tar entry %s to %s" name to-file))) 807 (message "Copied tar entry %s to %s" name to-file)))
797 808
798 (defun tar-flag-deleted (p &optional unflag) 809 (defun tar-flag-deleted (p &optional unflag)
799 "*In Tar mode, mark this sub-file to be deleted from the tar file. 810 "*In Tar mode, mark this sub-file to be deleted from the tar file.