diff options
author | Karl Heuer <kwzh@gnu.org> | 1994-04-25 18:26:20 +0000 |
---|---|---|
committer | Karl Heuer <kwzh@gnu.org> | 1994-04-25 18:26:20 +0000 |
commit | fe5c1c7d1b292e01be24996a4fb18c0b2220ddbe (patch) | |
tree | 72e8754006db055b6749edd99e4debfd49910ec6 /lisp/tar-mode.el | |
parent | 9a4cfcea5da5dbdf1e36735162a8ae2881b1e7fa (diff) | |
download | emacs-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.el | 21 |
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. |