[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnorb 9bf56f2 135/449: Refactor extraction of mails fro
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnorb 9bf56f2 135/449: Refactor extraction of mails from records |
Date: |
Fri, 27 Nov 2020 23:15:25 -0500 (EST) |
branch: externals/gnorb
commit 9bf56f2d5c2aee8f329f2cada187038602fb7ff1
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>
Refactor extraction of mails from records
lisp/gnorb-org.el: (gnorb-org-extract-mail-stuff) Used to pull the mail
addresses from BBDB records itself. Now passes the
records out, and lets the caller do the extraction.
This is so bbdb-posting-styles can do their thing in
`gnorb-org-handle-mail' and
`gnorb-org-email-subtree', which are looking more and
more like they need to be merged.
---
lisp/gnorb-org.el | 30 +++++++++++++++++-------------
1 file changed, 17 insertions(+), 13 deletions(-)
diff --git a/lisp/gnorb-org.el b/lisp/gnorb-org.el
index 427dbf5..3c5d8f2 100644
--- a/lisp/gnorb-org.el
+++ b/lisp/gnorb-org.el
@@ -237,7 +237,7 @@ STRATEGY will be disregarded."
(org-element-property :contents-end p)))
nil nil 'drawer))
state-strategy text-strategy search-func
- strings state-success all-links bbdb-mails)
+ strings state-success all-links)
(when (listp strategy)
(setq state-strategy (car strategy)
text-strategy (nth 1 strategy)))
@@ -337,12 +337,7 @@ STRATEGY will be disregarded."
(setq strings (delq nil strings))
(when (and strings (not all-links))
(setq all-links (gnorb-org-find-links strings search-func)))
- (when (plist-get all-links :bbdb)
- (dolist (b (plist-get all-links :bbdb))
- (push (gnorb-bbdb-link-to-mail b) bbdb-mails)))
- (list (plist-get all-links :gnus)
- (append bbdb-mails
- (plist-get all-links :mail))))))
+ all-links)))
(defun gnorb-org-scan-log-notes (state-log strategy)
;; `gnorb-org-extract-mail-stuff' was way too long already
@@ -522,14 +517,19 @@ current heading."
(unless (org-back-to-heading t)
(error "Not in an org item"))
(cl-flet ((mp (p) (org-entry-get (point) p t)))
- (let* ((mail-stuff (gnorb-org-extract-mail-stuff strategy region))
+ (let* ((links (gnorb-org-extract-mail-stuff strategy region))
(attachments (gnorb-org-attachment-list))
(from (mp "MAIL_FROM"))
(cc (mp "MAIL_CC"))
(bcc (mp "MAIL_BCC"))
- (org-id (org-id-get-create)))
+ (org-id (org-id-get-create))
+ mails)
+ (when (plist-get links :bbdb)
+ (dolist (b (plist-get links :bbdb))
+ (push (gnorb-bbdb-link-to-mail b) mails)))
(gnorb-org-setup-message
- (first mail-stuff) (second mail-stuff)
+ (plist-get links :gnus) ; gnus links
+ (append mails (plist-get links :mail))
from cc bcc
attachments nil org-id))))))
@@ -691,18 +691,22 @@ default set of parameters."
(nth 1 gnorb-org-mail-scan-strategies))
((equal '(16) arg)
(nth 2 gnorb-org-mail-scan-strategies))))
- (mail-stuff (gnorb-org-extract-mail-stuff strategy))
+ (links (gnorb-org-extract-mail-stuff strategy))
(attachments (gnorb-org-attachment-list))
(org-id (org-id-get-create))
- text)
+ text mails)
;; this should just go into a call to `org-handle-mail', passing
;; the results of the export as an argument
(setq gnorb-org-window-conf (current-window-configuration))
(if (bufferp result)
(setq text result)
(push result attachments))
+ (when (plist-get links :bbdb)
+ (dolist (b (plist-get links :bbdb))
+ (push (gnorb-bbdb-link-to-mail b) mails)))
(gnorb-org-setup-message
- (first mail-stuff) (second mail-stuff)
+ (plist-get links :gnus)
+ (append mails (plist-get links :mails))
nil nil nil ;; when this calls into `org-handle-mail' all this
;; will be sorted
attachments text org-id)))
- [elpa] externals/gnorb 1a40d11 130/449: Checking wishlist items off, (continued)
- [elpa] externals/gnorb 1a40d11 130/449: Checking wishlist items off, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 372986c 132/449: Fix call of key-description, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 9ecb0e2 136/449: Use BBDB posting styles in mail composition, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 1d9c710 139/449: Error in following link should be re-raised, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 5a86970 109/449: Improvements to outgoing todo handling, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb ac97c90 118/449: Let gnorb-org-view work in the Agenda as well, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb a512d40 124/449: Largely re-wrote gnorb-gnus-outgoing-do-todo, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb dad66e6 131/449: Better separate triggering for sent/received msgs, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb baf896c 100/449: Cruft! How the hell did that happen?, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 3ffcdab 101/449: Create .gitignore file, ignoring *elc files, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 9bf56f2 135/449: Refactor extraction of mails from records,
Stefan Monnier <=
- [elpa] externals/gnorb c6b7c04 137/449: Minor README edits, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb e44ece6 102/449: Multiple misnamed variables in bbdb posting styles, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 9f5466d 103/449: Edits courtesy of byte-compiler warnings, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 8fc575c 108/449: Improvements to incoming message handling, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb a9d7518 113/449: Make sure we're visiting an id when we cache it, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb d7f6301 123/449: Possibly safer arguments to nnir group creation, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 74c5cef 134/449: Add (probably unnecessary) &optional to prefix args, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 689bdd3 148/449: Use = not eq for numbers, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 31304ac 151/449: Whoops, we were using that, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 7cf46c3 149/449: Don't use `read' when there's nothing to read, Stefan Monnier, 2020/11/27