diff options
author | Richard M. Stallman <rms@gnu.org> | 1995-05-01 05:23:49 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1995-05-01 05:23:49 +0000 |
commit | 50e4c4b9537b8d6ca3f4a8e08700b3f9609b0d40 (patch) | |
tree | a146600c78e18929788ffb73bcadc0f9c940ff91 /lisp/jka-compr.el | |
parent | 9af119282fedc9b77a250c598da777f622b438dc (diff) | |
download | emacs-50e4c4b9537b8d6ca3f4a8e08700b3f9609b0d40.tar.gz |
(jka-compr-write-region): Handle the append
argument correctly when the can-append flag is false.
(jka-compr-write-region): Make temp-buffer name unique to this fn.
(jka-compr-file-local-copy): Ditto.
Diffstat (limited to 'lisp/jka-compr.el')
-rw-r--r-- | lisp/jka-compr.el | 50 |
1 files changed, 15 insertions, 35 deletions
diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el index e5975037ffe..b25e527c9a6 100644 --- a/lisp/jka-compr.el +++ b/lisp/jka-compr.el @@ -181,7 +181,7 @@ based on the filename itself and `jka-compr-compression-info-list'." (put 'compression-error 'error-conditions '(compression-error file-error error)) -(defvar jka-compr-acceptable-retval-list '(0 141)) +(defvar jka-compr-acceptable-retval-list '(0 2 141)) (defun jka-compr-error (prog args infile message &optional errfile) @@ -361,50 +361,30 @@ There should be no more than seven characters after the final `/'") (uncompress-message (jka-compr-info-uncompress-message info)) (compress-args (jka-compr-info-compress-args info)) (uncompress-args (jka-compr-info-uncompress-args info)) - (temp-file (jka-compr-make-temp-name)) (base-name (file-name-nondirectory visit-file)) - cbuf temp-buffer) + temp-file cbuf temp-buffer) (setq cbuf (current-buffer) - temp-buffer (get-buffer-create " *jka-compr-temp*")) + temp-buffer (get-buffer-create " *jka-compr-wr-temp*")) (set-buffer temp-buffer) (widen) (erase-buffer) (set-buffer cbuf) - (and append - (not can-append) - (file-exists-p filename) - (let* ((local-copy (file-local-copy filename)) - (local-file (or local-copy filename))) - - (unwind-protect - - (progn - - (and - uncompress-message - (message "%s %s..." uncompress-message base-name)) - - (jka-compr-call-process uncompress-program - (concat uncompress-message - " " base-name) - local-file - temp-file - temp-buffer - uncompress-args) - (and - uncompress-message - (message "%s %s...done" uncompress-message base-name))) - - (and - local-copy - (file-exists-p local-copy) - (delete-file local-copy))))) + (if (and append + (not can-append) + (file-exists-p filename)) + + (let* ((local-copy (file-local-copy filename)) + (local-file (or local-copy filename))) + + (setq temp-file local-file)) + + (setq temp-file (jka-compr-make-temp-name))) (and compress-message (message "%s %s..." compress-message base-name)) - + (jka-compr-run-real-handler 'write-region (list start end temp-file t 'dont)) @@ -585,7 +565,7 @@ There should be no more than seven characters after the final `/'") (local-copy (jka-compr-run-real-handler 'file-local-copy (list filename))) (temp-file (jka-compr-make-temp-name t)) - (temp-buffer (get-buffer-create " *jka-compr-temp*")) + (temp-buffer (get-buffer-create " *jka-compr-flc-temp*")) (notfound nil) (cbuf (current-buffer)) local-file) |