[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-mime 5df12989cd 101/118: clean code
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-mime 5df12989cd 101/118: clean code |
Date: |
Wed, 5 Jan 2022 07:58:50 -0500 (EST) |
branch: elpa/org-mime
commit 5df12989cdcceaa74b7e964e2d915804e8a4fd1a
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: Chen Bin <chenbin.sh@gmail.com>
clean code
---
org-mime.el | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/org-mime.el b/org-mime.el
index 7befee16b4..c35e96cb6a 100644
--- a/org-mime.el
+++ b/org-mime.el
@@ -225,17 +225,22 @@ buffer holding the text to be exported.")
"Return nil unless org-mime-export-ascii is set to a valid value."
(car (memq org-mime-export-ascii '(ascii utf-8 latin1))))
+(defun org-mime-export-ascii-maybe (text-for-ascii text-for-plain)
+ "Export `TEXT-FOR-ASCII' to ascii format or use TEXT-FOR-PLAIN."
+ (let* ((ascii-charset (org-mime-use-ascii-charset)))
+ (cond
+ (ascii-charset
+ (setq org-ascii-charset ascii-charset)
+ (org-export-string-as text-for-ascii 'ascii nil opts))
+ (t
+ text-for-plain))))
+
(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* (
- (ascii-charset (org-mime-use-ascii-charset))
(opts (org-mime-get-export-options subtreep))
- (plain (if ascii-charset
- (progn
- (setq org-ascii-charset ascii-charset)
- (org-export-string-as (buffer-string) 'ascii nil opts))
- (buffer-string)))
+ (plain (org-mime-export-ascii-maybe (buffer-string) (buffer-string)))
(buf (org-export-to-buffer 'html "*Org Mime Export*"
nil subtreep nil opts))
(body (prog1
@@ -485,11 +490,7 @@ If called with an active region only export that region,
otherwise entire body."
;; to hold attachments for inline html images
(opts (org-mime-get-buffer-export-options))
(ascii-charset (org-mime-use-ascii-charset))
- (plain (if ascii-charset
- (progn
- (setq org-ascii-charset ascii-charset)
- (org-export-string-as (concat org-mime-default-header
org-text) 'ascii nil opts))
- org-text))
+ (plain (org-mime-export-ascii-maybe (concat org-mime-default-header
org-text) org-text))
(html (org-mime-export-string (concat org-mime-default-header
org-text) opts))
(file (make-temp-name (expand-file-name
"mail" temporary-file-directory))))
- [nongnu] elpa/org-mime 7bcb075550 060/118: CI and TDD, fixed some minor bug. bump 0.1.2, (continued)
- [nongnu] elpa/org-mime 7bcb075550 060/118: CI and TDD, fixed some minor bug. bump 0.1.2, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 286330fa15 069/118: fixed: LaTeX fragment not exported correctly, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 6c7ddeaade 068/118: fixed CI, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 73c13fdd0b 075/118: Merge pull request #39 from czan/master, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 1162095645 086/118: Catch signature in html convert, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 722a295672 088/118: Merge pull request #48 from ahttraga/sigfix, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 168fe3a6a1 092/118: Merge pull request #51 from borwickatuw/master, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 4e5d50789b 097/118: Clean up name of test file in comment, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 73fdd3f40d 098/118: Merge pull request #53 from tomheon/clean-up-test-header, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime d71f57dc0d 096/118: Add a simple test for quoting of multi-line paragraphs, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 5df12989cd 101/118: clean code,
ELPA Syncer <=
- [nongnu] elpa/org-mime d725955399 105/118: stop bundling htmlize, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime e5345ae5b6 104/118: fixed ci, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 23cc52bb53 111/118: donot htmlize security signature and attachment, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime d52a7b52b6 114/118: fixed revert plain text email bug, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime b1fc1cc53c 116/118: Fix byte-compiler warnings, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 613969effc 118/118: Merge pull request #67 from skangas/silence-byte-compiler, ELPA Syncer, 2022/01/05