]> git.eshelyaron.com Git - emacs.git/commitdiff
Decode RFC2047 encoded Subject lines for mail replies.
authorPeter S Galbraith <psg@debian.org>
Wed, 19 May 2010 12:23:40 +0000 (08:23 -0400)
committerPeter S Galbraith <psg@debian.org>
Wed, 19 May 2010 12:23:40 +0000 (08:23 -0400)
lisp/mh-e/ChangeLog
lisp/mh-e/mh-comp.el
lisp/mh-e/mh-mime.el

index e3c9599b873fbefb7c590c124ce4e4c402a5a3ed..29a49c45a38422935f9b162721b8d5fd2ffcefea 100644 (file)
@@ -1,3 +1,10 @@
+2010-05-14  Peter S Galbraith  <psg@debian.org>
+
+       * 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  <cyd@stupidchicken.com>
 
        * Version 23.2 released.
index 3bb1e34325391662d534fb41d306651137a0f582..762aad86080ea73b77ff04d48cf9a1de2df167b8 100644 (file)
@@ -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)
index a60f31e3ac2de28683597151fc5351e194780343..8d47af40ebd0ea359046becb3d50a60a1810808f 100644 (file)
@@ -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.