(mml-generate-mime): Allow specifying what the top-level part type is
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 10 Apr 2012 22:35:08 +0000 (00:35 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 10 Apr 2012 22:35:08 +0000 (00:35 +0200)
lisp/ChangeLog
lisp/mml.el

index 9c8a9d2..e259e48 100644 (file)
@@ -1,5 +1,8 @@
 2012-04-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * mml.el (mml-generate-mime): Allow specifying what the top-level part
+       type is.
+
        * gnus-start.el (gnus-clean-old-newsrc): Remove totally bogus
        `unexists' entries.
        (gnus-clean-old-newsrc): Fix last checkin.
index a9901d7..cc1aedf 100644 (file)
@@ -463,8 +463,10 @@ If MML is non-nil, return the buffer up till the correspondent mml tag."
 (defvar mml-multipart-number 0)
 (defvar mml-inhibit-compute-boundary nil)
 
-(defun mml-generate-mime ()
-  "Generate a MIME message based on the current MML document."
+(defun mml-generate-mime (&optional multipart-type)
+  "Generate a MIME message based on the current MML document.
+MULTIPART-TYPE defaults to \"mixed\", but can also
+be \"related\" or \"alternate\"."
   (let ((cont (mml-parse))
        (mml-multipart-number mml-multipart-number)
        (options message-options))
@@ -476,8 +478,9 @@ If MML is non-nil, return the buffer up till the correspondent mml tag."
            (if (and (consp (car cont))
                     (= (length cont) 1))
                (mml-generate-mime-1 (car cont))
-             (mml-generate-mime-1 (nconc (list 'multipart '(type . "mixed"))
-                                         cont)))
+             (mml-generate-mime-1
+              (nconc (list 'multipart (cons 'type (or multipart-type "mixed")))
+                     cont)))
            (setq options message-options)
            (buffer-string))
        (setq message-options options)))))