Change defcustom :version from 23.0 to 23.1.
[bpt/emacs.git] / lisp / gnus / mml.el
index c9dee3f..c703e13 100644 (file)
@@ -1,7 +1,7 @@
 ;;; mml.el --- A package for parsing and validating MML documents
 
 ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007 Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; This file is part of GNU Emacs.
@@ -97,7 +97,7 @@ type (e.g., text/plain) respectively, and DISPOSITION should be either
 the string \"attachment\" or the string \"inline\".  The value t for
 SUPERTYPE, SUBTYPE or TYPE matches any of those types.  The first
 match found will be used."
-  :version "23.0" ;; No Gnus
+  :version "23.1" ;; No Gnus
   :type (let ((dispositions '(radio :format "DISPOSITION: %v"
                                    :value "attachment"
                                    (const :format "%v " "attachment")
@@ -284,7 +284,8 @@ part.  This is for the internal use, you should never modify the value.")
                         (list
                          (intern (downcase (cdr (assq 'charset tag))))))
                        (t
-                        (mm-find-mime-charset-region point (point)))))
+                        (mm-find-mime-charset-region point (point)
+                                                     mm-hack-charsets))))
        (when (and (not raw) (memq nil charsets))
          (if (or (memq 'unknown-encoding mml-confirmation-set)
                  (message-options-get 'unknown-encoding)
@@ -874,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)
@@ -1104,7 +1110,7 @@ See Info node `(emacs-mime)Composing'.
   "The default directory where mml will find files.
 If not set, `default-directory' will be used."
   :type '(choice directory (const :tag "Default" nil))
-  :version "23.0" ;; No Gnus
+  :version "23.1" ;; No Gnus
   :group 'message)
 
 (defun mml-minibuffer-read-file (prompt)