GNU bug report logs -
#71080
30.0.50; UTF-8 used unconditionally when saving GPG file
Previous Next
Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>
Date: Mon, 20 May 2024 15:44:02 UTC
Severity: normal
Found in version 30.0.50
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: 71080 <at> debbugs.gnu.org
> Date: Mon, 20 May 2024 17:08:25 -0400
>
> \316\273 is the encoding of λ in UTF-8, not in `iso-2022-7bit`, so it
> seems pretty clear that Emacs encoded the buffer using (some version of)
> utf-8, thus disregarding the `coding:` cookie.
AFAICT, this is due to an (unsolicited? at least the log message is
silent about this particular part) change as part of commit
e78c15acf679, 4 years ago. Reverting that part makes your recipe work
as expected. Please try the patch below:
diff --git a/lisp/epa-file.el b/lisp/epa-file.el
index a4942e7..90cc91e 100644
--- a/lisp/epa-file.el
+++ b/lisp/epa-file.el
@@ -267,7 +267,14 @@ epa-file-write-region
(setq file (expand-file-name file))
(let* ((coding-system (or coding-system-for-write
(if (fboundp 'select-safe-coding-system)
- (let ((buffer-file-name file))
+ ;; This is needed because
+ ;; `auto-coding-alist' has
+ ;; `no-conversion' for *.gpg files,
+ ;; which would otherwise force
+ ;; `select-safe-coding-system' return
+ ;; `no-conversion'.
+ (let ((buffer-file-name
+ (file-name-sans-extension file)))
(select-safe-coding-system
(point-min) (point-max)))
buffer-file-coding-system)))
This bug report was last modified 1 year and 49 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.