branch: elpa/org-mime
commit f1175e3faba25d3f862a43392b69854cdd18be9d
Author: Chen Bin <[email protected]>
Commit: Chen Bin <[email protected]>
can htmlize new mail
---
org-mime.el | 34 ++++++++++++++++++++++------------
1 file changed, 22 insertions(+), 12 deletions(-)
diff --git a/org-mime.el b/org-mime.el
index 4a243482d5..776273b979 100644
--- a/org-mime.el
+++ b/org-mime.el
@@ -282,11 +282,21 @@ You could use either `org-up-heading-safe' or
`org-back-to-heading'.")
"<p>[\n\r]*>>>>> .* ==
\\([^\r\n]*\\)[\r\n]*</p>"
"<div class=\"gmail_quote\">\\1</div>"
html))
- (setq info (org-mime-encode-quoted-mail-body))
- (delete-region (nth 0 info) (nth 1 info))
- (goto-char (nth 0 info))
- (insert (nth 2 info))
- (buffer-substring-no-properties (point-min) (point-max)))))
+ (unwind-protect
+ (let (retval)
+ (condition-case ex
+ (setq info (org-mime-encode-quoted-mail-body))
+ (setq retval info)
+ ('error (setq info nil)))
+ retval))
+ (cond
+ (info
+ (delete-region (nth 0 info) (nth 1 info))
+ (goto-char (nth 0 info))
+ (insert (nth 2 info))
+ (buffer-substring-no-properties (point-min) (point-max)))
+ (t
+ html)))))
(t
html)))
@@ -295,13 +305,13 @@ You could use either `org-up-heading-safe' or
`org-back-to-heading'.")
If html portion of message includes IMAGES they are wrapped in
multipart/related part."
(cl-case org-mime-library
(mml (concat "<#multipart type=alternative><#part type=text/plain>"
- plain
- (when images "<#multipart type=related>")
- "<#part type=text/html>"
- (org-mime-cleanup-quoted html)
- images
- (when images "<#/multipart>\n")
- "<#/multipart>\n"))
+ plain
+ (when images "<#multipart type=related>")
+ "<#part type=text/html>"
+ (org-mime-cleanup-quoted html)
+ images
+ (when images "<#/multipart>\n")
+ "<#/multipart>\n"))
(semi (concat
"--" "<<alternative>>-{\n"
"--" "[[text/plain]]\n" plain