From e612d0b9ff5be52183cbce64cfbbccc3d9d2c7c6 Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Fri, 28 Jan 2011 12:53:36 -0700 Subject: [PATCH] org-mime: now possible to set mail subjects using the mail_subject property --- contrib/lisp/org-mime.el | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/contrib/lisp/org-mime.el b/contrib/lisp/org-mime.el index 233714136..d8bbb2e11 100644 --- a/contrib/lisp/org-mime.el +++ b/contrib/lisp/org-mime.el @@ -235,21 +235,22 @@ export that region, otherwise export the entire body." (save-restriction (org-narrow-to-subtree) (run-hooks 'org-mime-send-subtree-hook) - (let* ((file (buffer-file-name (current-buffer))) - (subject (nth 4 (org-heading-components))) - (to (org-entry-get nil "MAIL_TO" org-mime-use-property-inheritance)) - (cc (org-entry-get nil "MAIL_CC" org-mime-use-property-inheritance)) - (bcc (org-entry-get nil "MAIL_BCC" org-mime-use-property-inheritance)) - (body (buffer-substring - (save-excursion (goto-char (point-min)) - (forward-line 1) - (when (looking-at "[ \t]*:PROPERTIES:") - (re-search-forward ":END:" nil) - (forward-char)) - (point)) - (point-max)))) - (org-mime-compose body (or fmt 'org) file to subject - `((cc . ,cc) (bcc . ,bcc)))))) + (flet ((mp (p) (org-entry-get nil p org-mime-use-property-inheritance))) + (let* ((file (buffer-file-name (current-buffer))) + (subject (or (mp "MAIL_SUBJECT") (nth 4 (org-heading-components)))) + (to (mp "MAIL_TO")) + (cc (mp "MAIL_CC")) + (bcc (mp "MAIL_BCC")) + (body (buffer-substring + (save-excursion (goto-char (point-min)) + (forward-line 1) + (when (looking-at "[ \t]*:PROPERTIES:") + (re-search-forward ":END:" nil) + (forward-char)) + (point)) + (point-max)))) + (org-mime-compose body (or fmt 'org) file to subject + `((cc . ,cc) (bcc . ,bcc))))))) (defun org-mime-send-buffer (&optional fmt) (run-hooks 'org-mime-send-buffer-hook) -- 2.11.4.GIT