Subject: Re: bug#2017: 23.0.60; C-c in Rmail re-encodes quoted-printable parts

From: Eli Zaretskii <[email-masked]>
Date: Sat, 07 Feb 2009 17:25:31 +0200

> From: Richard M Stallman <[email-masked]>
> Date: Sun, 25 Jan 2009 13:14:38 -0500
> 
>       (setq character-coding (mail-fetch-field "content-transfer-encoding")
> 
> is supposed to get the encoding specified by the message header for
> the entire message, and it ought not notice anything specified
> in/for individual mime parts.
> 
> When this fails for you, what value does character-coding get?  If it
> is non-nil, can you step thru mail-fetch-field and see how that
> happened?

The problem was that the Rmail buffer was narrowed to the entire
message, whereas mail-fetch-field is documented to assume that the
buffer is narrowed to just the headers.  (Similar problems were with
calls to rmail-is-text-p and rmail-get-coding-system.)  I fixed that
by narrowing to the headers' portion only.

> Is it that the header specifies this field
> and the message also has mime parts?
> If so, rmail-cease-edit needs to operate only on the "body"
> and not on any mime parts.

If the header specifies content-transfer-encoding, then Rmail will
decode the entire message body, including the MIME parts, by this
encoding.  So it is correct to re-apply that encoding in
rmail-cease-edit to the whole body.

> In addition, rmail-cease-edit ought to check for editing done in
> message headers, and install the edited headers into the message.
> Ideally it should make a list of the headers initially shown
> so that it can tell if the user deleted any headers and delete those
> from the message.

It looks like rmail-cease-edit does not support editing the headers at
all at this time.  But that is a separate problem; I will file a new
bug report for it.