From b59ee24dfb243e087c09abe66638480491c0ba18 Mon Sep 17 00:00:00 2001 From: Peter S Galbraith Date: Wed, 19 May 2010 08:23:40 -0400 Subject: [PATCH] Decode RFC2047 encoded Subject lines for mail replies. --- lisp/mh-e/ChangeLog | 7 +++++++ lisp/mh-e/mh-comp.el | 3 +++ lisp/mh-e/mh-mime.el | 9 +++++++++ 3 files changed, 19 insertions(+) diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index e3c9599b873..29a49c45a38 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog @@ -1,3 +1,10 @@ +2010-05-14 Peter S Galbraith + + * mh-mime.el (mh-decode-message-subject): New function to decode + RFC2047 encoded Subject lines. Used for reply drafts. + * mh-comp.el (mh-compose-and-send-mail): Call + `mh-decode-message-subject' on (reply or forward) message drafts. + 2010-05-07 Chong Yidong * Version 23.2 released. diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el index 3bb1e343253..762aad86080 100644 --- a/lisp/mh-e/mh-comp.el +++ b/lisp/mh-e/mh-comp.el @@ -905,6 +905,9 @@ letter." (mh-identity-make-menu) (mh-identity-add-menu) + ;; Cleanup possibly RFC2047 encoded subject header + (mh-decode-message-subject) + ;; Insert extra fields. (mh-insert-x-mailer) (mh-insert-x-face) diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el index a60f31e3ac2..8d47af40ebd 100644 --- a/lisp/mh-e/mh-mime.el +++ b/lisp/mh-e/mh-mime.el @@ -507,6 +507,15 @@ decoding the same message multiple times." (let ((buffer-read-only nil)) (rfc2047-decode-region (point-min) (mh-mail-header-end))))) +;;;###mh-autoload +(defun mh-decode-message-subject () + "Decode RFC2047 encoded message header fields." + (when mh-decode-mime-flag + (save-excursion + (let ((buffer-read-only nil)) + (rfc2047-decode-region (progn (mh-goto-header-field "subject:") (point)) + (progn (mh-header-field-end) (point))))))) + ;;;###mh-autoload (defun mh-mime-display (&optional pre-dissected-handles) "Display (and possibly decode) MIME handles. -- 2.39.2