# HG changeset patch # User Peter S Galbraith # Date 1274271820 14400 # Node ID 7be123ae7612ead570fa4b4d4b4e096c3f34eee2 # Parent ba70090bc7789c8dc0467feeb0ce555619fd1c06 Decode RFC2047 encoded Subject lines for mail replies. diff -r ba70090bc778 -r 7be123ae7612 lisp/mh-e/ChangeLog --- a/lisp/mh-e/ChangeLog Wed May 19 10:22:41 2010 +0300 +++ b/lisp/mh-e/ChangeLog Wed May 19 08:23:40 2010 -0400 @@ -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 -r ba70090bc778 -r 7be123ae7612 lisp/mh-e/mh-comp.el --- a/lisp/mh-e/mh-comp.el Wed May 19 10:22:41 2010 +0300 +++ b/lisp/mh-e/mh-comp.el Wed May 19 08:23:40 2010 -0400 @@ -905,6 +905,9 @@ (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 -r ba70090bc778 -r 7be123ae7612 lisp/mh-e/mh-mime.el --- a/lisp/mh-e/mh-mime.el Wed May 19 10:22:41 2010 +0300 +++ b/lisp/mh-e/mh-mime.el Wed May 19 08:23:40 2010 -0400 @@ -508,6 +508,15 @@ (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. Optional argument, PRE-DISSECTED-HANDLES is a list of MIME