[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-mime 4bd5d55ba9 071/118: fixed logic
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-mime 4bd5d55ba9 071/118: fixed logic |
Date: |
Wed, 5 Jan 2022 07:58:48 -0500 (EST) |
branch: elpa/org-mime
commit 4bd5d55ba9bca84ffd938b477c72d701cf3736df
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: Chen Bin <chenbin.sh@gmail.com>
fixed logic
---
org-mime.el | 20 ++++++--------------
test/org-mime-tests.el | 28 ++++++++++++++++++++++++++++
2 files changed, 34 insertions(+), 14 deletions(-)
diff --git a/org-mime.el b/org-mime.el
index 0fb34a3954..97c964a9be 100644
--- a/org-mime.el
+++ b/org-mime.el
@@ -482,20 +482,12 @@ If SUBTREEP is t, curret org node is subtree."
(defun org-mime-build-mail-other-headers (cc bcc from)
"Build mail header from CC, BCC, and FROM."
- (cond
- ((and cc bcc from)
- (list (cons "Cc" cc)
- (cons "Bcc" bcc)
- (cons "From" from)
- ))
- (cc
- (list (cons "Cc" cc)))
- (bcc
- (list (cons "Bcc" bcc)))
- (from
- (list (cons "From" from)))
- (t
- nil)))
+ (let* ((arr (list (cons "Cc" cc) (cons "Bcc" bcc) (cons "From" from )))
+ rlt)
+ (dolist (e arr)
+ (when (cdr e)
+ (push e rlt)))
+ rlt))
;;;###autoload
(defun org-mime-org-buffer-htmlize ()
diff --git a/test/org-mime-tests.el b/test/org-mime-tests.el
index 556b3b552a..dea0846277 100644
--- a/test/org-mime-tests.el
+++ b/test/org-mime-tests.el
@@ -86,4 +86,32 @@
(setq str (buffer-string)))
(should (string-match "<#multipart" str))))
+(ert-deftest test-org-mime-build-mail-other-headers ()
+ (let* ((cc "cc@m.c")
+ (bcc "bcc@m.c")
+ (from "from@m.c")
+ h)
+ ;; CC
+ (setq h (nth 0 (org-mime-build-mail-other-headers cc nil nil)))
+ (should (string= (car h) "Cc"))
+
+ ;; CC and BCC
+ (setq h (nth 0 (org-mime-build-mail-other-headers cc bcc nil)))
+ (should (string= (car h) "Bcc"))
+ (should (string= (cdr h) bcc))
+ (setq h (nth 1 (org-mime-build-mail-other-headers cc bcc nil)))
+ (should (string= (car h) "Cc"))
+ (should (string= (cdr h) cc))
+
+ ;; CC, BCC, and FROM
+ (setq h (nth 0 (org-mime-build-mail-other-headers cc bcc from)))
+ (should (string= (car h) "From"))
+ (should (string= (cdr h) from))
+ (setq h (nth 1 (org-mime-build-mail-other-headers cc bcc from)))
+ (should (string= (car h) "Bcc"))
+ (should (string= (cdr h) bcc))
+ (setq h (nth 2 (org-mime-build-mail-other-headers cc bcc from)))
+ (should (string= (car h) "Cc"))
+ (should (string= (cdr h) cc))))
+
(ert-run-tests-batch-and-exit)
\ No newline at end of file
- [nongnu] elpa/org-mime d540da37df 026/118: make it emacs 24.3 compatible, (continued)
- [nongnu] elpa/org-mime d540da37df 026/118: make it emacs 24.3 compatible, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime c0e99cfdfa 028/118: README, ELPA Syncer, 2022/01/05
- [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 <=
- [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, 2022/01/05
- [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