Changes committed gnus/lisp (ChangeLog gnus-art.el mm-decode.el mml.el)

"Katsumi Yamaoka" <[email protected]>
Newsgroups gmane.emacs.gnus.commits
Message-ID <[email protected]>
Modified: ChangeLog gnus-art.el mm-decode.el mml.el

* gnus-art.el (gnus-insert-mime-button): Don't decode description.

* mm-decode.el (mm-dissect-buffer): Decode description.

* mml.el (mml-to-mime): Encode message header first.


Index: ChangeLog
diff -u gnus/lisp/ChangeLog:7.1740 gnus/lisp/ChangeLog:7.1741
--- ChangeLog:7.1740	Sun Jan 20 06:23:57 2008
+++ ChangeLog	Wed Jan 23 08:48:31 2008
@@ -1,3 +1,11 @@
+2008-01-23  Katsumi Yamaoka  <[email protected]>
+
+	* gnus-art.el (gnus-insert-mime-button): Don't decode description.
+
+	* mm-decode.el (mm-dissect-buffer): Decode description.
+
+	* mml.el (mml-to-mime): Encode message header first.
+
 2008-01-18  Katsumi Yamaoka  <[email protected]>
 
 	* gnus-art.el (gnus-article-describe-bindings): Make it possible to use
Index: gnus-art.el
diff -u gnus/lisp/gnus-art.el:7.258 gnus/lisp/gnus-art.el:7.259
--- gnus-art.el:7.258	Sun Jan 20 06:23:57 2008
+++ gnus-art.el	Wed Jan 23 08:48:31 2008
@@ -5455,9 +5455,7 @@
 	     (mail-content-type-get (mm-handle-type handle) 'url)
 	     ""))
 	(gnus-tmp-type (mm-handle-media-type handle))
-	(gnus-tmp-description
-	 (mail-decode-encoded-word-string (or (mm-handle-description handle)
-					      "")))
+	(gnus-tmp-description (or (mm-handle-description handle) ""))
 	(gnus-tmp-dots
 	 (if (if displayed (car displayed)
 	       (mm-handle-displayed-p handle))
Index: mm-decode.el
diff -u gnus/lisp/mm-decode.el:7.61 gnus/lisp/mm-decode.el:7.62
--- mm-decode.el:7.61	Sun Jan 20 06:23:57 2008
+++ mm-decode.el	Wed Jan 23 08:48:31 2008
@@ -570,7 +570,10 @@
 	  ;; creates unibyte buffers. This `if', though not a perfect
 	  ;; solution, avoids most of them.
 	  (if from
-	      (setq from (cadr (mail-extract-address-components from))))))
+	      (setq from (cadr (mail-extract-address-components from))))
+	  (if description
+	      (setq description (mail-decode-encoded-word-string
+				 description)))))
       (if (or (not ctl)
 	      (not (string-match "/" (car ctl))))
 	  (mm-dissect-singlepart
Index: mml.el
diff -u gnus/lisp/mml.el:7.59 gnus/lisp/mml.el:7.60
--- mml.el:7.59	Sun Jan 20 06:23:57 2008
+++ mml.el	Wed Jan 23 08:48:31 2008
@@ -875,14 +875,19 @@
 
 (defun mml-to-mime ()
   "Translate the current buffer from MML to MIME."
-  (message-encode-message-body)
+  ;; `message-encode-message-body' will insert an encoded Content-Description
+  ;; header in the message header if the body contains a single part
+  ;; that is specified by a user with a MML tag containing a description
+  ;; token.  So, we encode the message header first to prevent the encoded
+  ;; Content-Description header from being encoded again.
   (save-restriction
     (message-narrow-to-headers-or-head)
     ;; Skip past any From_ headers.
     (while (looking-at "From ")
       (forward-line 1))
     (let ((mail-parse-charset message-default-charset))
-      (mail-encode-encoded-word-buffer))))
+      (mail-encode-encoded-word-buffer)))
+  (message-encode-message-body))
 
 (defun mml-insert-mime (handle &optional no-markup)
   (let (textp buffer mmlp)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.