[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-mime d3ae6df753 013/118: Merge pull request #2 from ac
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-mime d3ae6df753 013/118: Merge pull request #2 from acowley/subtree |
Date: |
Wed, 5 Jan 2022 07:58:42 -0500 (EST) |
branch: elpa/org-mime
commit d3ae6df753282b4913e8e414aea4cd653454673e
Merge: dfe41e05e2 ffbf3e3e47
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: GitHub <noreply@github.com>
Merge pull request #2 from acowley/subtree
Support mime encoding current subtree
---
org-mime.el | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/org-mime.el b/org-mime.el
index 61d0abe982..13bed2ceda 100644
--- a/org-mime.el
+++ b/org-mime.el
@@ -98,10 +98,10 @@ buffer holding\nthe text to be exported.")
(defvar org-mime-send-buffer-hook nil
"Hook to run in the Org-mode file before export.")
-(defun org-mime--export-string (s)
+(defun org-mime--export-string (s &optional opts)
(if (fboundp 'org-export-string-as)
;; emacs24
- (org-export-string-as s 'html t)
+ (org-export-string-as s 'html t opts)
;; emacs 23
(org-export-string s "html")))
@@ -263,7 +263,17 @@ it is not set."
(body (buffer-substring body-start body-end)))
(org-mime-compose body file nil subject)))
-(defun org-mime-compose (body file &optional to subject headers)
+(defun org-mime-send-subtree ()
+ (run-hooks 'org-mime-send-buffer-hook)
+ (save-excursion
+ (org-up-heading-safe)
+ (let* ((file (buffer-file-name (current-buffer)))
+ (subject (nth 4 (org-heading-components)))
+ (opts (org-export--get-subtree-options))
+ (body (org-get-entry)))
+ (org-mime-compose body file nil subject nil opts))))
+
+(defun org-mime-compose (body file &optional to subject headers opts)
(let* ((fmt 'html))
(unless (featurep 'message)
(require 'message))
@@ -283,7 +293,7 @@ it is not set."
(org-export-htmlize-output-type 'inline-css)
(html-and-images
(org-mime-replace-images
- (org-mime--export-string (bhook body 'html)) file))
+ (org-mime--export-string (bhook body 'html) opts) file))
(images (cdr html-and-images))
(html (org-mime-apply-html-hook (car html-and-images))))
(insert (org-mime-multipart (org-babel-trim body) html)
@@ -296,5 +306,12 @@ it is not set."
(interactive)
(org-mime-send-buffer))
+(defun org-mime-org-subtree-htmlize ()
+ "Create an email buffer containing the current subtree of the
+ current org-mode file exported to html and encoded in both html
+ and in org formats as mime alternatives."
+ (interactive)
+ (org-mime-send-subtree))
+
(provide 'org-mime)
;;; org-mime.el ends here
- [nongnu] elpa/org-mime 484bf3b0b8 083/118: can edit mail-body in org-mode buffer directly, (continued)
- [nongnu] elpa/org-mime 484bf3b0b8 083/118: can edit mail-body in org-mode buffer directly, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 5980ccaace 080/118: fixed unit test, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime b129579986 087/118: Regexp search for sig sep, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 30bb3e663d 117/118: Merge pull request #66 from skangas/gplv3, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 4105d1bb9c 004/118: support Emacs 23.4, 24.3 24.4, 24.5, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime e9b0be2860 005/118: mails need NO TOC, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 3a16180195 006/118: clean code according to org-mode review, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 351b233a7e 018/118: Don't use obsoleted function, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 44e7a78ffd 019/118: Fix for cl-lib, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime dfe41e05e2 012/118: Merge pull request #1 from acowley/subject, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime d3ae6df753 013/118: Merge pull request #2 from acowley/subtree,
ELPA Syncer <=
- [nongnu] elpa/org-mime 957bb3b43a 014/118: Merge pull request #3 from acowley/plain-part, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime b00d23aa1d 022/118: explicitly require org export libs, ELPA Syncer, 2022/01/05
- [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