summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2002-08-17 05:00:30 +0000
committerRichard M. Stallman <rms@gnu.org>2002-08-17 05:00:30 +0000
commit76bf6666897923af632a6a2c8f1de051a6a7bb45 (patch)
treeb4176b873ff6d41188b1a1da39e35bf066e5abed
parent13ef5524b50bc990c90233595f5142b8767bdae2 (diff)
downloademacs-76bf6666897923af632a6a2c8f1de051a6a7bb45.tar.gz
(tar-subfile-mode): Use add-hook and remove-hook, and use
write-file-functions instead of local-write-file-hooks. (tar-untar-buffer): Don't try to extract directories.
-rw-r--r--lisp/tar-mode.el16
1 files changed, 8 insertions, 8 deletions
diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el
index 400dbdad134..9f34858cab2 100644
--- a/lisp/tar-mode.el
+++ b/lisp/tar-mode.el
@@ -388,11 +388,12 @@ MODE should be an integer which is a file mode value."
(dir (file-name-directory name))
(start (+ (tar-desc-data-start descriptor) tar-header-offset -1))
(end (+ start (tar-header-size tokens))))
- (message "Extracting %s" name)
- (if (and dir (not (file-exists-p dir)))
- (make-directory dir t))
- (write-region start end name)
- (set-file-modes name (tar-header-mode tokens)))))
+ (unless (file-directory-p name)
+ (message "Extracting %s" name)
+ (if (and dir (not (file-exists-p dir)))
+ (make-directory dir t))
+ (write-region start end name)
+ (set-file-modes name (tar-header-mode tokens))))))
(set-buffer-multibyte multibyte))))
(defun tar-summarize-buffer ()
@@ -604,14 +605,13 @@ appear on disk when you save the tar-file's buffer."
(not tar-subfile-mode)
(> (prefix-numeric-value p) 0)))
(cond (tar-subfile-mode
- (make-local-variable 'local-write-file-hooks)
- (setq local-write-file-hooks '(tar-subfile-save-buffer))
+ (add-hook 'write-file-functions 'tar-subfile-save-buffer nil t)
;; turn off auto-save.
(auto-save-mode -1)
(setq buffer-auto-save-file-name nil)
(run-hooks 'tar-subfile-mode-hook))
(t
- (kill-local-variable 'local-write-file-hooks))))
+ (remove-hook 'write-file-functions 'tar-subfile-save-buffer t))))
;; Revert the buffer and recompute the dired-like listing.