Commit 30c78e11 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(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.
parent 221cbd7d
......@@ -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,45 +361,25 @@ 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
(if (and append
(not can-append)
(file-exists-p filename)
(file-exists-p filename))
(let* ((local-copy (file-local-copy filename))
(local-file (or local-copy filename)))
(unwind-protect
(progn
(setq temp-file local-file))
(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)))))
(setq temp-file (jka-compr-make-temp-name)))
(and
compress-message
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment