all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Ken Olum <kdo@cosmos.phy.tufts.edu>
Cc: kdo@cosmos.phy.tufts.edu, 28671@debbugs.gnu.org
Subject: bug#28671: 25.2; double transfer-encoding in rmailedit for complex mime messages
Date: Mon, 02 Oct 2017 19:37:55 +0300	[thread overview]
Message-ID: <834lrh33q4.fsf@gnu.org> (raw)
In-Reply-To: <q52a819blx1.fsf@cosmos.phy.tufts.edu> (message from Ken Olum on Mon, 02 Oct 2017 11:37:46 -0400)

> From: Ken Olum <kdo@cosmos.phy.tufts.edu>
> Date: Mon, 02 Oct 2017 11:37:46 -0400
> Cc: kdo@cosmos.phy.tufts.edu
> 
> When rmail-edit-current-message gets a mime message which is too complex
> for it to handle (i.e., anything but one "text/plain" part), it just
> gives you the raw message to edit.  If you do so, rmail-cease-edit then
> applies the transfer-encoding even though the message wasn't decoded,
> and so on.  It also in some circumstances it also moves the marker for
> the beginning of the following message.
> 
> The attached patch modifies rmail-cease-edit to check the
> rmail-old-mime-state flag set by rmail-edit-current-message when it is
> editing the raw message.  If set, rmail-cease-edit inserts the
> already-encoded body without further processing.  It also deletes the
> old body after inserting the new, rather than before, to avoid moving
> the next message's marker.

Thanks.  Could you please send a small mbox file which could be used
to reproduce the problem and test the solution?

A couple of minor comments to the patch:

>  	;; Re-apply content-transfer-encoding, if any, on the message body.
> -	(cond
> -	 ((string= character-coding "quoted-printable")
> -	  (mail-quote-printable-region start (point-max)))
> -	 ((and (string= character-coding "base64") is-text-message)
> -	  (base64-encode-region start (point-max)))
> -	 ((and (eq character-coding 'uuencode) is-text-message)
> -	  (error "uuencoded messages are not supported")))
> +        (unless mime-state              ; if set, already transfer-encoded
> +          (cond
> +           ((string= character-coding "quoted-printable")
> +            (mail-quote-printable-region start end))
> +           ((and (string= character-coding "base64") is-text-message)
> +            (base64-encode-region start end))
> +           ((and (eq character-coding 'uuencode) is-text-message)
> +            (error "uuencoded messages are not supported"))))

You could easily make the change less intrusive by simply adding the
mime-state condition as the first alternative in 'cond' with no
action, right?

Also, please add a commit log message for the changes formatted as a
ChangeLog entry (e.g., using "C-x 4 a").





  reply	other threads:[~2017-10-02 16:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-02 15:37 bug#28671: 25.2; double transfer-encoding in rmailedit for complex mime messages Ken Olum
2017-10-02 16:37 ` Eli Zaretskii [this message]
2017-10-02 17:47   ` Ken Olum
2017-10-09 13:55     ` Eli Zaretskii

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=834lrh33q4.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=28671@debbugs.gnu.org \
    --cc=kdo@cosmos.phy.tufts.edu \
    /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.