[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-mime 7bcb075550 060/118: CI and TDD, fixed some minor
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-mime 7bcb075550 060/118: CI and TDD, fixed some minor bug. bump 0.1.2 |
Date: |
Wed, 5 Jan 2022 07:58:47 -0500 (EST) |
branch: elpa/org-mime
commit 7bcb075550d2b9ea6010997dec135db0c73154f6
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: Chen Bin <chenbin.sh@gmail.com>
CI and TDD, fixed some minor bug. bump 0.1.2
---
.travis.yml | 30 +++++++++++++++++++++
Makefile | 15 +++++++++++
README.org | 2 +-
org-mime.el | 28 +++++++++----------
test/org-mime-tests.el | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 132 insertions(+), 16 deletions(-)
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000000..09ff39cc7c
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,30 @@
+language: generic
+
+env:
+ global:
+ - CURL="curl -fsSkL --retry 9 --retry-delay 9"
+ matrix:
+ - EMACS_VERSION=24.4
+ - EMACS_VERSION=24.5
+ - EMACS_VERSION=25.3
+ - EMACS_VERSION=26.1
+ - EMACS_VERSION=master
+
+matrix:
+ allow_failures:
+ - env: EMACS_VERSION=master
+
+install:
+ - $CURL -O
https://github.com/npostavs/emacs-travis/releases/download/bins/emacs-bin-${EMACS_VERSION}.tar.gz
+ - tar -xaf emacs-bin-${EMACS_VERSION}.tar.gz -C /
+ - export EMACS=/tmp/emacs/bin/emacs
+
+script:
+ - $EMACS --version
+ - emacs=$EMACS make test
+
+notifications:
+ email:
+ # Default is change, but that includes a new branch's 1st success.
+ on_success: never
+ on_failure: always
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000000..dd10b063fa
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,15 @@
+SHELL = /bin/sh
+EMACS ?= emacs
+PROFILER =
+
+.PHONY: test
+
+# Delete byte-compiled files etc.
+clean:
+ rm -f *~
+ rm -f \#*\#
+ rm -f *.elc
+
+# Run tests.
+test: clean
+ $(EMACS) -batch -Q -l org-mime.el -l test/org-mime-tests.el
diff --git a/README.org b/README.org
index e5c0a15f73..6e318ce21c 100644
--- a/README.org
+++ b/README.org
@@ -1,4 +1,4 @@
-* org-mime v0.1.1
+* org-mime v0.1.2
org-mime can be used to send HTML email using Org-mode HTML export.
This approximates a WYSiWYG HTML mail editor from within Emacs, and can be
useful for sending tables, fontified source code, and inline images in email.
diff --git a/org-mime.el b/org-mime.el
index e30fc26483..810076fd41 100644
--- a/org-mime.el
+++ b/org-mime.el
@@ -6,7 +6,7 @@
;; Maintainer: Chen Bin (redguardtoo)
;; Keywords: mime, mail, email, html
;; Homepage: http://github.com/org-mime/org-mime
-;; Version: 0.1.1
+;; Version: 0.1.2
;; Package-Requires: ((emacs "24.4") (cl-lib "0.5"))
;; This file is not part of GNU Emacs.
@@ -162,7 +162,7 @@ This could be used for example to post-process html
elements.")
(defvar org-mime-pre-html-hook nil
"Hook to run before html export.
Functions should take no arguments and will be run in a
-buffer holdin the text to be exported.")
+buffer holding the text to be exported.")
(defvar org-mime-send-buffer-hook nil
"Hook to run in the Org-mode file before export.")
@@ -461,24 +461,22 @@ If called with an active region only export that region,
otherwise entire body."
"Create mail BODY in FILE with TO, SUBJECT, HEADERS.
If SUBTREEP is t, curret org node is subtree."
;; start composing mail
- (unless (featurep 'message)
- (require 'message))
- (message-mail to subject headers nil)
- (message-goto-body)
-
- ;; insert text
- (let* ((str (with-temp-buffer
+ (let* ((export-opts (org-mime-get-export-options subtreep))
+ str)
+ (unless (featurep 'message)
+ (require 'message))
+ (message-mail to subject headers nil)
+ (message-goto-body)
+ (setq str (with-temp-buffer
(insert body)
(goto-char (point-min))
(run-hooks 'org-mime-pre-html-hook)
- (buffer-string))))
- (org-mime-insert-html-content body
- file
- str
- (org-mime-get-export-options subtreep))))
+ (buffer-string)))
+ ;; insert text
+ (org-mime-insert-html-content body file str export-opts)))
(defun org-mime-extract-keywords ()
- "Extract keyword from "
+ "Extract keywords."
(cond
((>= (org-mime-org-major-version) 9)
(org-element-map (org-element-parse-buffer) 'keyword
diff --git a/test/org-mime-tests.el b/test/org-mime-tests.el
new file mode 100644
index 0000000000..41e8019d93
--- /dev/null
+++ b/test/org-mime-tests.el
@@ -0,0 +1,73 @@
+;; counsel-etags-tests.el --- unit tests for counsel-etags -*- coding: utf-8
-*-
+
+;; Author: Chen Bin <chenbin DOT sh AT gmail DOT com>
+
+;;; License:
+
+;; This file is not part of GNU Emacs.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; if not, write to the Free Software
+;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+;;; Commentary:
+
+(require 'ert)
+(require 'org-mime)
+(require 'message)
+
+(defconst mail-header '("To: myname@mail.com\n"
+ "Subject: test subject\n"
+ "From: My Name <myname@yahoo.com>\n"
+ "--text follows this line--\n"))
+(defconst mail-footer '("--\n"
+ "Yous somebody\n\n"
+ "--\n"
+ "Some quote\n"))
+
+(ert-deftest test-org-mime-htmlize ()
+ (let* (str)
+ (with-temp-buffer
+ (apply #'insert mail-header)
+ (insert "* hello\n"
+ "** world\n"
+ "#+begin_src javascript\n"
+ "console.log('hello world');"
+ "#+end_src\n")
+ (apply #'insert mail-footer)
+ (message-mode)
+ (goto-char (point-min))
+ (org-mime-htmlize)
+ (setq str (buffer-string)))
+ (should (string-match "<#multipart" str))))
+
+(ert-deftest test-org-mime-org-subtree-htmlize ()
+ (let* (str opts)
+ (with-temp-buffer
+ (insert "* hello\n"
+ "** world\n"
+ "#+begin_src javascript\n"
+ "console.log('hello world');"
+ "#+end_src\n")
+ (org-mode)
+ (goto-char (point-min))
+ (setq opts (org-mime-get-export-options t))
+ (should opts)
+ (org-mime-org-subtree-htmlize)
+ (switch-to-buffer (car (message-buffers)))
+ (setq str (buffer-string)))
+ (should (string-match "^\* world" str))
+ (should (string-match "Subject: hello" str))
+ (should (string-match "<#multipart" str))))
+
+(ert-run-tests-batch-and-exit)
\ No newline at end of file
- [nongnu] elpa/org-mime 8d7797ea07 007/118: clean code according to org review, (continued)
- [nongnu] elpa/org-mime 8d7797ea07 007/118: clean code according to org review, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime b33c96b2d0 015/118: embedded image could use absolute path, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime dd1b9881af 027/118: remove drawers when org-mime-htmlize-subtree at emacs 24.3, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 8067e76eb1 029/118: add documentation on embedded image, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 80b4e3a3b4 008/118: add readme, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime fb265448df 038/118: Merge pull request #14 from unhammer/issue13-OPTIONS-noise, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 0752659f7a 042/118: No drawer exporting (default since Emacs 25), ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime db707a7337 040/118: Merge pull request #15 from unhammer/patch-1, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime bc61d4de7d 045/118: Merge pull request #18 from jkitchin/master, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 7e89b4b741 053/118: move cond out of the cleanup function, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 7bcb075550 060/118: CI and TDD, fixed some minor bug. bump 0.1.2,
ELPA Syncer <=
- [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, 2022/01/05