summaryrefslogtreecommitdiff
path: root/lisp/tar-mode.el
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1994-04-25 18:26:20 +0000
committerKarl Heuer <kwzh@gnu.org>1994-04-25 18:26:20 +0000
commitfe5c1c7d1b292e01be24996a4fb18c0b2220ddbe (patch)
tree72e8754006db055b6749edd99e4debfd49910ec6 /lisp/tar-mode.el
parent9a4cfcea5da5dbdf1e36735162a8ae2881b1e7fa (diff)
downloademacs-fe5c1c7d1b292e01be24996a4fb18c0b2220ddbe.tar.gz
(tar-copy): Don't bother with a temp buffer.
Diffstat (limited to 'lisp/tar-mode.el')
-rw-r--r--lisp/tar-mode.el21
1 files changed, 4 insertions, 17 deletions
diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el
index 00fff38487b..b1edbe0375b 100644
--- a/lisp/tar-mode.el
+++ b/lisp/tar-mode.el
@@ -749,23 +749,10 @@ the current tar-entry."
(size (tar-header-size tokens))
(start (+ (tar-desc-data-start descriptor) tar-header-offset -1))
(end (+ start size)))
- (let* ((tar-buffer (current-buffer))
- buffer)
- (unwind-protect
- (progn
- (setq buffer (generate-new-buffer "*tar-copy-tmp*"))
- (widen)
- (save-excursion
- (set-buffer buffer)
- (insert-buffer-substring tar-buffer start end)
- (set-buffer-modified-p nil) ; in case we abort
- (write-file to-file)
- (message "Copied tar entry %s to %s" name to-file)
- (set-buffer tar-buffer)))
- (narrow-to-region 1 tar-header-offset)
- (if buffer (kill-buffer buffer)))
- )))
-
+ (save-restriction
+ (widen)
+ (write-region start end to-file))
+ (message "Copied tar entry %s to %s" name to-file)))
(defun tar-flag-deleted (p &optional unflag)
"*In Tar mode, mark this sub-file to be deleted from the tar file.