From 7c5935db501e6c5c141587043053718df343316e Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Wed, 11 Apr 2012 00:35:08 +0200 Subject: [PATCH] (mml-generate-mime): Allow specifying what the top-level part type is --- lisp/ChangeLog | 3 +++ lisp/mml.el | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9c8a9d218..e259e48c9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-04-10 Lars Magne Ingebrigtsen + * 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. diff --git a/lisp/mml.el b/lisp/mml.el index a9901d716..cc1aedf1b 100644 --- a/lisp/mml.el +++ b/lisp/mml.el @@ -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))))) -- 2.25.1