[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-mime caa1f19d4b 009/118: Fix getting the subect
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-mime caa1f19d4b 009/118: Fix getting the subect |
Date: |
Wed, 5 Jan 2022 07:58:41 -0500 (EST) |
branch: elpa/org-mime
commit caa1f19d4bfccaf022af780aec228210b4fd5f75
Author: Anthony Cowley <acowley@gmail.com>
Commit: Anthony Cowley <acowley@gmail.com>
Fix getting the subect
org-export-grab-title-from-buffer is obsolete as far as I can tell.
---
org-mime.el | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/org-mime.el b/org-mime.el
index 1a15d3bf15..61d0abe982 100644
--- a/org-mime.el
+++ b/org-mime.el
@@ -239,16 +239,28 @@ export that region, otherwise export the entire body."
(defmacro org-mime-try (&rest body)
`(condition-case nil ,@body (error nil)))
+(defun org-mime--get-buffer-title ()
+ "Returns the `TITLE' option of the current buffer, or `nil' if
+it is not set."
+ (let ((tmp (plist-get (org-export--get-inbuffer-options) :title)))
+ (when tmp
+ (let ((txt (car tmp)))
+ (set-text-properties 0 (length txt) nil txt)
+ txt))))
+
(defun org-mime-send-buffer ()
(run-hooks 'org-mime-send-buffer-hook)
(let* ((region-p (org-region-active-p))
- (subject (org-export-grab-title-from-buffer))
(file (buffer-file-name (current-buffer)))
+ (subject (or (org-mime--get-buffer-title)
+ (if (not file) (buffer-name (buffer-base-buffer))
+ (file-name-sans-extension
+ (file-name-nondirectory file)))))
(body-start (or (and region-p (region-beginning))
(save-excursion (goto-char (point-min)))))
(body-end (or (and region-p (region-end)) (point-max)))
- (temp-body-file (make-temp-file "org-mime-export"))
- (body (buffer-substring body-start body-end)))
+ (temp-body-file (make-temp-file "org-mime-export"))
+ (body (buffer-substring body-start body-end)))
(org-mime-compose body file nil subject)))
(defun org-mime-compose (body file &optional to subject headers)
- [nongnu] branch elpa/org-mime created (now 613969effc), ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime a1a7fb329f 003/118: clean doc, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 3c4f24c8d4 016/118: clean code. github organization created, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 2347595278 002/118: emacs24 use org-export-string instead of org-export-string-as, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime a0b82a6c1a 024/118: better export format (not TOC, etc) and bug fix, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 9d32b819f0 025/118: updated README, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime caa1f19d4b 009/118: Fix getting the subect,
ELPA Syncer <=
- [nongnu] elpa/org-mime 0311662889 017/118: Correct 'interactive' position, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime ffbf3e3e47 010/118: Support mime encoding current subtree, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime c49eb00fc6 021/118: can create email from org subtree, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime e554d8821d 020/118: Merge pull request #1 from syohex/fix-package, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 91d8f48775 023/118: can set org export options, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 7c3483b2b0 030/118: sample for advanced setup, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime e3329c7c4d 032/118: README, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 0a0aa9b110 034/118: README, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime ad30f199cb 036/118: provide org-mime-find-html-start callback, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 5f253f541c 037/118: only use export header when creating html, keep out of email, ELPA Syncer, 2022/01/05