[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnorb bb21414 075/449: Provide more escapes for outgoin
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnorb bb21414 075/449: Provide more escapes for outgoing capture templates |
Date: |
Fri, 27 Nov 2020 23:15:11 -0500 (EST) |
branch: externals/gnorb
commit bb21414c203f1f0174ea909639f18dd07e559dd6
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>
Provide more escapes for outgoing capture templates
lisp/gnorb-gnus.el: (gnorb-gnus-check-outgoing-headers
gnorb-gnus-sending-message-info,
gnorb-gnus-outgoing-make-todo-1)
Provide for the %:toname and %:toaddress escapes
when capturing TODOs from outgoing mails.
---
lisp/gnorb-gnus.el | 34 ++++++++++++++++++++--------------
1 file changed, 20 insertions(+), 14 deletions(-)
diff --git a/lisp/gnorb-gnus.el b/lisp/gnorb-gnus.el
index df6f86e..575f8f5 100644
--- a/lisp/gnorb-gnus.el
+++ b/lisp/gnorb-gnus.el
@@ -241,20 +241,22 @@ information about the outgoing message into
`gnorb-gnus-sending-message-info'."
(save-restriction
(message-narrow-to-headers)
- (let ((org-ids (mail-fetch-field gnorb-mail-header nil nil t))
- (msg-id (mail-fetch-field "Message-ID"))
- (to (mail-fetch-field "To"))
- (subject (mail-fetch-field "Subject"))
- (date (mail-fetch-field "Date"))
- ;; if we can get a link, that's awesome
- (link (or (and (mail-fetch-field "Gcc")
- (org-store-link))
- nil)))
+ (let* ((org-ids (mail-fetch-field gnorb-mail-header nil nil t))
+ (msg-id (mail-fetch-field "Message-ID"))
+ (to (mail-fetch-field "To"))
+ (toname (nth 1 (mail-extract-address-components to)))
+ (toaddress (nth 2 (mail-extract-address-components to)))
+ (subject (mail-fetch-field "Subject"))
+ (date (mail-fetch-field "Date"))
+ ;; if we can get a link, that's awesome
+ (link (or (and (mail-fetch-field "Gcc")
+ (org-store-link))
+ nil)))
;; if we can't, then save some information so we can fake it
(setq gnorb-gnus-sending-message-info
`(:subject ,subject :msg-id ,msg-id
- :to ,to :link ,link
- :date ,date))
+ :to ,to :toname ,toname :toaddress ,toaddress
+ :link ,link :date ,date))
(if org-ids
(progn
(require 'gnorb-org)
@@ -289,8 +291,9 @@ something, and your outgoing messages have a \"Fcc\"
header),
then a real link will be made to the outgoing message, and all
the gnus-type escapes will be available (see the Info
manual (org) Template expansion section). If you don't, then the
-%:subject, %:to, and %:date escapes for the outgoing message will
-still be available -- nothing else will work."
+%:subject, %:to, %:toname, %:toaddress, and %:date escapes for
+the outgoing message will still be available -- nothing else will
+work."
(interactive "P")
(if (not (eq major-mode 'message-mode))
(gnorb-gnus-outgoing-make-todo-1)
@@ -312,6 +315,8 @@ still be available -- nothing else will work."
(error "No capture template key set, customize
gnorb-gnus-new-todo-capture-key"))
(let* ((subject (plist-get gnorb-gnus-sending-message-info :subject))
(to (plist-get gnorb-gnus-sending-message-info :to))
+ (toname (plist-get gnorb-gnus-sending-message-info :toaddress))
+ (toaddress (plist-get gnorb-gnus-sending-message-info :toaddress))
(date (plist-get gnorb-gnus-sending-message-info :date))
(msg-id (plist-get gnorb-gnus-sending-message-info :msg-id))
(link (plist-get gnorb-gnus-sending-message-info :link))
@@ -320,7 +325,8 @@ still be available -- nothing else will work."
(org-capture-link-is-already-stored
(or link t)))
(setq org-store-link-plist
- `(:subject ,subject :to ,to :date ,date))
+ `(:subject ,subject :to ,to :toname ,toname
+ :toaddress ,toaddress :date ,date))
(org-capture nil gnorb-gnus-new-todo-capture-key)
(when msg-id
(org-entry-put (point) gnorb-org-msg-id-key msg-id))))
- [elpa] externals/gnorb 8246cd4 064/449: Restore from mails more reliably, (continued)
- [elpa] externals/gnorb 8246cd4 064/449: Restore from mails more reliably, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 89b57f0 066/449: Whoops., Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 9f13881 067/449: First whack at gnorb-gnus-message-trigger-todo, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb e472348 073/449: New hook gnorb-org-after-message-setup-hook, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb a165584 041/449: Handle return from mail sending better, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 7ffc885 043/449: Commenting out my re-implementation of map-y-or-n-p, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 6152e85 059/449: Comments on editing messages, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb d786b81 063/449: Random comment edits and indenting changes., Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 77698aa 071/449: Split 'gnorb-org-email-subtree-parameters', Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 3a2cd3b 072/449: Improve scanning of headings for mail actions, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb bb21414 075/449: Provide more escapes for outgoing capture templates,
Stefan Monnier <=
- [elpa] externals/gnorb cd1f289 076/449: Guess which Org TODO is related to this message, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 856da2b 077/449: Improve `gnorb-gnus-outgoing-make-todo', Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 5812648 078/449: FUNCTION RENAMING, I'M VERY SORRY, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 582c111 080/449: Let gnorb-gnus-check-outgoing-headers handle news, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 92354d0 082/449: Allow use of some org-mime properties, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb b81f3e2 083/449: Don't assume any ID references on incoming messages, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 1cdec4b 086/449: New option gnorb-org-find-candidates-match, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb c2a3793 087/449: Don't prompt for action if todo is not possible, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 78e1e2b 090/449: Use custom refile targets in re-attaching files, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 7950d3a 091/449: Comment and indentation changes only, Stefan Monnier, 2020/11/27