[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-mime d827dbfb97 077/118: Add option to export ASCII fo
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-mime d827dbfb97 077/118: Add option to export ASCII for text/plain section |
Date: |
Wed, 5 Jan 2022 07:58:48 -0500 (EST) |
branch: elpa/org-mime
commit d827dbfb970b5ce9939761c2eaed52b3bd211006
Author: konezny <konezny@users.noreply.github.com>
Commit: konezny <konezny@users.noreply.github.com>
Add option to export ASCII for text/plain section
Add an option to export plain text, latin1, or utf-8 ASCII for the
text/plain section in the outgoing email message. The default is to use
the original org-mode file.
---
README.org | 19 +++++++++++++++++++
org-mime.el | 18 ++++++++++++++++--
2 files changed, 35 insertions(+), 2 deletions(-)
diff --git a/README.org b/README.org
index bd6f1a2454..88859fb951 100644
--- a/README.org
+++ b/README.org
@@ -127,6 +127,25 @@ Thibault Marin provided
[[https://lists.gnu.org/archive/html/emacs-orgmode/2019-
(search-forward "<#secure method=pgpmime mode=sign>")
(+ (point) 1))))
#+end_src
+** ASCII export options for text/plain
+Use =org-mime-export-ascii= to export the org-mode file as ASCII for the
+=text/plain= section of the email message. The default is to export the
+original unmodified org-mode file.
+
+ASCII export options:
+- plain text
+ #+begin_src elisp
+(setq org-mime-export-ascii 'ascii)
+ #+end_src
+- latin1
+ #+begin_src elisp
+(setq org-mime-export-ascii 'latin1)
+ #+end_src
+- utf-8
+ #+begin_src elisp
+(setq org-mime-export-ascii 'utf-8)
+ #+end_src
+
* Development
- Patches are always welcomed
- You can =(setq org-mime-debug t)= to enable the log
diff --git a/org-mime.el b/org-mime.el
index f2222c8e23..c6dc1de437 100644
--- a/org-mime.el
+++ b/org-mime.el
@@ -136,6 +136,12 @@ And ensure first line isn't assumed to be a title line."
:group 'org-mime
:type '(choice 'mml 'semi 'vm))
+(defcustom org-mime-export-ascii nil
+ "ASCII export options for text/plain.
+Default (nil) selects the original org-mode file."
+ :group 'org-mime
+ :type '(choice 'ascii 'latin1 'utf-8))
+
(defcustom org-mime-preserve-breaks t
"Temporary value of `org-export-preserve-breaks' during mime encoding."
:group 'org-mime
@@ -197,7 +203,15 @@ buffer holding the text to be exported.")
(defun org-mime-export-buffer-or-subtree (subtreep)
"Similar to `org-html-export-as-html' and `org-org-export-as-org'.
SUBTREEP is t if current node is subtree."
- (let* ((plain (buffer-string))
+ (let* (
+ (plain
+ (cl-case org-mime-export-ascii
+ (ascii (org-export-string-as (buffer-string) 'ascii nil
'(:ascii-charset ascii)))
+ (latin1 (org-export-string-as (buffer-string) 'ascii nil
'(:ascii-charset latin1)))
+ (utf-8 (org-export-string-as (buffer-string) 'ascii nil
'(:ascii-charset utf-8)))
+ (t (buffer-string)) ;; default is the original org file
+ )
+ )
(buf (org-export-to-buffer 'html "*Org Mime Export*"
nil subtreep nil (org-mime-get-export-options subtreep)))
(body (prog1
@@ -290,7 +304,7 @@ HTML is the body of the message."
"Markup a multipart/alternative with HTML alternatives.
If html portion of message includes IMAGES they are wrapped in
multipart/related part."
(cl-case org-mime-library
- (mml (concat "<#multipart type=alternative>\n<#part type=text/plain>"
+ (mml (concat "<#multipart type=alternative>\n<#part type=text/plain>\n"
plain
(when images "<#multipart type=related>")
"<#part type=text/html>"
- [nongnu] elpa/org-mime f1175e3fab 035/118: can htmlize new mail, (continued)
- [nongnu] elpa/org-mime f1175e3fab 035/118: can htmlize new mail, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 895a7c31bb 052/118: Merge pull request #23 from liujoey/master, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 11965c407f 055/118: rewrite beautify function, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime cf7dbea171 054/118: rename cleanup function to match beautify user option, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 53e0c8141b 058/118: one-line fix for klipse errors in org-mime, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime baa6cde22f 057/118: Merge pull request #25 from tmurph/blockquote-parser, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 1b516d604a 056/118: remove unnecessary dependency, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 817744f3b1 062/118: remove plain text body, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 4bd5d55ba9 071/118: fixed logic, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime dd9dac74cc 073/118: doc on html export, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime d827dbfb97 077/118: Add option to export ASCII for text/plain section,
ELPA Syncer <=
- [nongnu] elpa/org-mime 3596bbfe10 079/118: Fix: #36 Add ASCII export for org-mime-htmlize, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 3974bd4190 093/118: make checkdoc happy, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime b47811562b 099/118: Merge pull request #52 from tomheon/fix-gmail-quoting, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 4580e345cb 102/118: add emacs 27 ci, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 0caaf273e7 011/118: Use a plain ASCII export for the text part, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 62791db188 033/118: beautify quoted mail properly, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 7a6dae2494 039/118: Lisp error: (error "Too many arguments") – should be defcustom, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime b9def25bf4 043/118: Edit docstrings for checkdoc compatibility., ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 6593522166 051/118: Fix: #22, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime ea7a470872 061/118: add badge, ELPA Syncer, 2022/01/05