summaryrefslogtreecommitdiff
path: root/lisp/tar-mode.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2009-11-07 18:19:48 +0000
committerChong Yidong <cyd@stupidchicken.com>2009-11-07 18:19:48 +0000
commit6960d7b9bd5f7a3de26bc79ef2686a96f69f86ef (patch)
tree7d2727b300035f1f28dab53f3ca9737c74efe1e4 /lisp/tar-mode.el
parentb42b2189a37b5f5186d1731acf129ba9a3c15ff7 (diff)
downloademacs-6960d7b9bd5f7a3de26bc79ef2686a96f69f86ef.tar.gz
* tar-mode.el (tar-copy): Call write-region on the right buffer
(Bug#4857).
Diffstat (limited to 'lisp/tar-mode.el')
-rw-r--r--lisp/tar-mode.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el
index 0e681f56702..eb7054d8844 100644
--- a/lisp/tar-mode.el
+++ b/lisp/tar-mode.el
@@ -909,12 +909,14 @@ the current tar-entry."
(end (+ start size))
(inhibit-file-name-handlers inhibit-file-name-handlers)
(inhibit-file-name-operation inhibit-file-name-operation))
- (save-restriction
- (widen)
+ (with-current-buffer
+ (if (tar-data-swapped-p) tar-data-buffer (current-buffer))
;; 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))
+ (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)