From 4599d0ec2152952709e6f9302d44f453a4db7391 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Thu, 24 Jan 2008 07:47:38 +0000 Subject: [PATCH] Merge from gnus--devo--0 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1009 --- lisp/gnus/ChangeLog | 8 ++++++++ lisp/gnus/gnus-art.el | 4 +--- lisp/gnus/mm-decode.el | 5 ++++- lisp/gnus/mml.el | 9 +++++++-- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 569789888dd..dbba5fd608e 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,11 @@ +2008-01-23 Katsumi Yamaoka + + * 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 * gnus-art.el (gnus-article-describe-bindings): Make it possible to use diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 6e41f413609..f93a304be46 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -5455,9 +5455,7 @@ N is the numerical prefix." (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)) diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index 8e88ffca6bb..f832a9c28e1 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -570,7 +570,10 @@ Postpone undisplaying of viewers for types in ;; 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 diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el index 04f8ef4e462..2b5987e5e6e 100644 --- a/lisp/gnus/mml.el +++ b/lisp/gnus/mml.el @@ -875,14 +875,19 @@ If HANDLES is non-nil, use it instead reparsing the buffer." (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) -- 2.39.2