From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jon Miller Subject: [PATCH] org-mime: make plain/text mime export a choice Date: Mon, 31 Aug 2015 17:55:06 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWZqz-00061F-HU for emacs-orgmode@gnu.org; Mon, 31 Aug 2015 20:55:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWZqw-0000yl-OX for emacs-orgmode@gnu.org; Mon, 31 Aug 2015 20:55:13 -0400 Received: from mail-pa0-x22b.google.com ([2607:f8b0:400e:c03::22b]:35280) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWZqw-0000yH-17 for emacs-orgmode@gnu.org; Mon, 31 Aug 2015 20:55:10 -0400 Received: by pacdd16 with SMTP id dd16so156164214pac.2 for ; Mon, 31 Aug 2015 17:55:08 -0700 (PDT) Received: from localhost ([129.46.72.190]) by smtp.gmail.com with ESMTPSA id b9sm7571348pdl.47.2015.08.31.17.55.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Aug 2015 17:55:07 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Update to how org-mime constructs emails for the plain/text section of the mime email. I've found that using the 'ascii exporter produces a saner plain/text section than using the 'org exporter. Added a new custom variable to control which exporter is used. and changed the default behavior to use 'ascii. Below is my git formatted patch. -- Jon Miller >From 7dca81cc20b81ac36b7580efa756b66e7f8b1705 Mon Sep 17 00:00:00 2001 From: Jon Miller Date: Mon, 31 Aug 2015 17:32:53 -0700 Subject: [PATCH] org-mime: make plain/text mime export a choice * org-mime (org-mime-htmlize, org-mime-compose): Introduce a new customize variable `org-mime-plain-text-export-format' to control how the plain/text portion of the mime formatted email is exported. Defaults to 'ascii over previous hard coded 'org choice. The 'ascii export does a better job in formatting your email in the plain/text portion of the mime encoded message than to org format. Making this configurable and changing the default to ascii. TINYCHANGE --- contrib/lisp/org-mime.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/contrib/lisp/org-mime.el b/contrib/lisp/org-mime.el index 197c712..10a56eb 100644 --- a/contrib/lisp/org-mime.el +++ b/contrib/lisp/org-mime.el @@ -70,6 +70,12 @@ :group 'org-mime :type 'string) +(defcustom org-mime-plain-text-export-format 'ascii + "Which format to export to when filling the text/plain mime + section" + :group 'org-mime + :type '(choice 'org 'ascii)) + (defcustom org-mime-library 'mml "Library to use for marking up MIME elements." :group 'org-mime @@ -214,7 +220,7 @@ export that region, otherwise export the entire body." (buffer-substring html-start html-end))) (tmp-file (make-temp-name (expand-file-name "mail" temporary-file-directory))) - (body (org-export-string-as raw-body 'org t)) + (body (org-export-string-as raw-body org-mime-plain-text-export-format t)) ;; because we probably don't want to export a huge style file (org-export-htmlize-output-type 'inline-css) ;; makes the replies with ">"s look nicer @@ -324,7 +330,7 @@ export that region, otherwise export the entire body." (org-export-string-as (org-babel-trim (funcall bhook body (if (eq fmt 'html) 'org 'ascii))) - (if (eq fmt 'html) 'org 'ascii) t) + org-mime-plain-text-export-format t) html) (mapconcat 'identity images "\n"))))))) -- 2.4.3