GNU bug report logs -
#18141
24.4.50; saving .gz file breaks file coding
Previous Next
Reported by: Katsumi Yamaoka <yamaoka <at> jpl.org>
Date: Tue, 29 Jul 2014 07:01:02 UTC
Severity: important
Found in version 24.4.50
Fixed in version 24.3.93
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> --- lisp/files.el~0 2014-06-29 06:54:20 +0300
> +++ lisp/files.el 2014-08-06 17:26:42 +0300
> @@ -4835,13 +4835,17 @@
> (nth 1 setmodes)))
> (set-file-modes buffer-file-name
> (logior (car setmodes) 128))))))
> - (let (success)
> + (let ((filename-is-magic (find-file-name-handler buffer-file-name
> + 'write-region))
> + success)
> (unwind-protect
> ;; Pass in nil&nil rather than point-min&max to indicate
> ;; we're saving the buffer rather than just a region.
> ;; write-region-annotate-functions may make us of it.
> - (let ((coding-system-for-write writecoding)
> - (coding-system-require-warning nil))
> + (let ((coding-system-for-write
> + (if filename-is-magic coding-system-for-write writecoding))
> + (coding-system-require-warning
> + (if filename-is-magic coding-system-require-warning)))
> (write-region nil nil
> buffer-file-name nil t buffer-file-truename)
> (setq success t))
I can vaguely guess why that avoids the problem, but I'm having a hard
time seeing why the above is "right". IOW it seems like an ugly
workaround which may itself come with unintended consequences.
Stefan
This bug report was last modified 10 years and 345 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.