summaryrefslogtreecommitdiff
path: root/lisp/jka-compr.el
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1998-06-05 15:54:48 +0000
committerKarl Heuer <kwzh@gnu.org>1998-06-05 15:54:48 +0000
commit70c7850e9c7001512df5b247bed197590355011d (patch)
tree85715ab41b27e706f199d0a5a77a38ee25346aff /lisp/jka-compr.el
parent303901fb14d224be17001f0ce858cf1d7775e442 (diff)
downloademacs-70c7850e9c7001512df5b247bed197590355011d.tar.gz
(jka-compr-write-region): Ensure
`last-coding-system-used' is updated, so that basic-save-buffer sees the right value.
Diffstat (limited to 'lisp/jka-compr.el')
-rw-r--r--lisp/jka-compr.el13
1 files changed, 11 insertions, 2 deletions
diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el
index 20786429364..0ee24e94c66 100644
--- a/lisp/jka-compr.el
+++ b/lisp/jka-compr.el
@@ -306,7 +306,7 @@ to keep: LEN chars starting BEG chars from the beginning."
(let ((err-file (jka-compr-make-temp-name))
(coding-system-for-read (or coding-system-for-read 'undecided))
- (coding-system-for-write 'no-conversion) )
+ (coding-system-for-write 'no-conversion))
(unwind-protect
@@ -413,7 +413,11 @@ There should be no more than seven characters after the final `/'."
(compress-args (jka-compr-info-compress-args info))
(uncompress-args (jka-compr-info-uncompress-args info))
(base-name (file-name-nondirectory visit-file))
- temp-file temp-buffer)
+ temp-file temp-buffer
+ ;; we need to leave `last-coding-system-used' set to its
+ ;; value after calling write-region the first time, so
+ ;; that `basic-save-buffer' sees the right value.
+ (coding-system-used last-coding-system-used))
(setq temp-buffer (get-buffer-create " *jka-compr-wr-temp*"))
(with-current-buffer temp-buffer
@@ -436,6 +440,8 @@ There should be no more than seven characters after the final `/'."
(jka-compr-run-real-handler 'write-region
(list start end temp-file t 'dont))
+ ;; save value used by the real write-region
+ (setq coding-system-used last-coding-system-used)
;; Here we must read the output of compress program as is
;; without any code conversion.
@@ -478,6 +484,9 @@ There should be no more than seven characters after the final `/'."
(stringp visit))
(message "Wrote %s" visit-file))
+ ;; ensure `last-coding-system-used' has an appropriate value
+ (setq last-coding-system-used coding-system-used)
+
nil)
(jka-compr-run-real-handler 'write-region