From: Markus Rost <rost@math.uni-bielefeld.de>
To: emacs-pretest-bug@gnu.org
Subject: bug#4623: 23.1.50; rmail changes encoding of characters on save
Date: Sat, 3 Oct 2009 16:54:35 +0200 (CEST) [thread overview]
Message-ID: <20091003145435.75D5D288A0AB@xen12.math.uni-bielefeld.de> (raw)
With rmail I observed random encoding changes in mbox files: some
non-ascii characters are changed depending on which message you look
at while saving.
Providing a test case is a bit tiresome, so I omit one for now.
The reason for the problem is that rmail-expunge-and-save uses the
coding system of the current message when saving the file. This is
certainly wrong: the coding system for writing the mbox file must not
depend on the currently selected message.
Since rmail reads the mbox file with coding-system 'no-conversion, it
should save it with coding-system 'no-conversion.
Perhaps the problem sits in rmail-swap-buffers: Shouldn't
rmail-swap-buffers exchange the value of buffer-file-coding-system in
both ways? Or perhaps it should ensure that the buffer which contains
the full mbox file has always the same buffer-file-coding-system,
namely 'no-conversion.
Anyway, the following ad hoc patch fixes the problem for me.
*** rmail.el.~1.552.~ 2009-09-26 21:21:07.000000000 +0200
--- rmail.el 2009-10-02 16:14:30.000000000 +0200
***************
*** 1458,1464 ****
(rmail-expunge)
;; No need to swap buffers: rmail-write-region-annotate takes care of it.
;; (rmail-swap-buffers-maybe)
! (save-buffer)
(if (rmail-summary-exists)
(rmail-select-summary (set-buffer-modified-p nil))))
--- 1458,1465 ----
(rmail-expunge)
;; No need to swap buffers: rmail-write-region-annotate takes care of it.
;; (rmail-swap-buffers-maybe)
! (let ((coding-system-for-write 'no-conversion))
! (save-buffer))
(if (rmail-summary-exists)
(rmail-select-summary (set-buffer-modified-p nil))))
In GNU Emacs 23.1.50.1 (i686-pc-linux-gnu, GTK+ Version 2.16.1)
of 2009-10-02 on laptop
Windowing system distributor `The X.Org Foundation', version 11.0.10600000
configured using `configure '--prefix=/home/rost/local/cvs''
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: C
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: nil
locale-coding-system: utf-8-unix
default enable-multibyte-characters: t
next reply other threads:[~2009-10-03 14:54 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <22r5t2emso.fsf@fencepost.gnu.org>
2009-10-03 14:54 ` Markus Rost [this message]
2009-10-13 1:21 ` bug#4623: 23.1.50; rmail changes encoding of characters on save Glenn Morris
2009-10-13 2:16 ` Markus Rost
2009-10-17 3:20 ` bug#4623: marked as done (23.1.50; rmail changes encoding of characters on save) Emacs bug Tracking System
2009-12-04 16:36 bug#4623: 23.1.50; rmail changes encoding of characters on save Eli Zaretskii
2009-12-04 17:16 ` Glenn Morris
2009-12-04 18:42 ` Stefan Monnier
2009-12-04 19:15 ` Eli Zaretskii
2009-12-04 19:48 ` Stefan Monnier
2009-12-05 12:03 ` Eli Zaretskii
2009-12-05 20:10 ` Markus Rost
2009-12-05 21:52 ` Eli Zaretskii
2009-12-05 22:37 ` Markus Rost
2009-12-06 4:10 ` Eli Zaretskii
2009-12-06 14:40 ` Markus Rost
2009-12-06 19:17 ` Eli Zaretskii
2009-12-06 20:23 ` Markus Rost
2009-12-07 4:04 ` Eli Zaretskii
2009-12-07 19:22 ` Eli Zaretskii
2009-12-07 19:50 ` Markus Rost
2009-12-07 19:51 ` Eli Zaretskii
2009-12-07 4:34 ` Stefan Monnier
2009-12-07 18:59 ` Eli Zaretskii
2009-12-07 19:25 ` Stefan Monnier
2009-12-07 19:53 ` Eli Zaretskii
2009-12-07 21:44 ` Stefan Monnier
2009-12-08 4:14 ` Eli Zaretskii
2009-12-08 13:47 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091003145435.75D5D288A0AB@xen12.math.uni-bielefeld.de \
--to=rost@math.uni-bielefeld.de \
--cc=4623@emacsbugs.donarmstrong.com \
--cc=emacs-pretest-bug@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.