[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnorb 7ba1786 196/449: Use gnorb-gnus-message-info for
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnorb 7ba1786 196/449: Use gnorb-gnus-message-info for incoming and outgoing |
Date: |
Fri, 27 Nov 2020 23:15:37 -0500 (EST) |
branch: externals/gnorb
commit 7ba1786261760a3d38c82bcfd35a1615f46b43c1
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>
Use gnorb-gnus-message-info for incoming and outgoing
* lisp/gnorb-gnus.el (gnorb-gnus-incoming-do-todo): This function should
not be creating registry entries. It should just load
gnorb-gnus-message-info, same as outgoing does, and leave the rest to
gnorb-trigger-todo-action.
* lisp/gnorb-utils.el (gnorb-trigger-todo-action): Now responsible for
creating registry entries both for incoming and outgoing. It no longer
needs to "know" which is which.
---
lisp/gnorb-gnus.el | 20 +++++++++-------
lisp/gnorb-utils.el | 67 ++++++++++++++++++++++++++---------------------------
2 files changed, 45 insertions(+), 42 deletions(-)
diff --git a/lisp/gnorb-gnus.el b/lisp/gnorb-gnus.el
index 0c21346..bc2c3c4 100644
--- a/lisp/gnorb-gnus.el
+++ b/lisp/gnorb-gnus.el
@@ -479,17 +479,18 @@ to t (it is, by default)."
;; We should only store a link if it's not already at the head of
;; `org-stored-links'. There's some duplicate storage, at
;; present. Take a look at calling it non-interactively.
- (call-interactively 'org-store-link)
(setq gnorb-window-conf (current-window-configuration))
(move-marker gnorb-return-marker (point))
+ (setq gnorb-gnus-message-info nil)
(let* ((msg-id (mail-header-id headers))
- (sender (mail-header-from headers))
+ (from (mail-header-from headers))
(subject (mail-header-subject headers))
+ (date (mail-header-date headers))
+ (to (cdr (assoc 'To (mail-header-extra headers))))
(group gnus-newsgroup-name)
+ (link (call-interactively 'org-store-link))
(org-refile-targets gnorb-gnus-trigger-refile-targets)
- ;; otherwise `gnorb-trigger-todo-action' will think we
- ;; started from an outgoing message
- (gnorb-gnus-message-info nil)
+ ;;
(ref-msg-ids
(with-current-buffer gnus-original-article-buffer
(message-narrow-to-headers-or-head)
@@ -505,6 +506,11 @@ to t (it is, by default)."
(message "Gnorb can't check for relevant headings unless
`org-id-track-globally' is t")
(sit-for 1))))
targ)
+ (setq gnorb-gnus-message-info
+ `(:subject ,subject :msg-id ,msg-id
+ :to ,to :from ,from
+ :link ,link :date ,date :refs ,ref-msg-ids
+ :group ,group))
(gnorb-gnus-collect-all-attachments nil t)
;; Delete other windows, users can restore with
;; `gnorb-restore-layout'.
@@ -523,9 +529,7 @@ to t (it is, by default)."
(message
"Insert a link to the message with org-insert-link (%s)"
(key-description
- (where-is-internal 'org-insert-link nil t)))
- (gnorb-registry-make-entry
- msg-id sender subject (org-id-get-create) group)))
+ (where-is-internal 'org-insert-link nil t)))))
;;;###autoload
(defun gnorb-gnus-search-messages (str &optional ret)
diff --git a/lisp/gnorb-utils.el b/lisp/gnorb-utils.el
index b26ef23..0456a55 100644
--- a/lisp/gnorb-utils.el
+++ b/lisp/gnorb-utils.el
@@ -139,40 +139,39 @@ the prefix arg."
(point-at-bol))
ret-dest-todo (org-entry-get
root-marker "TODO"))
- (let ((sent-id (plist-get gnorb-gnus-message-info :msg-id)))
- (when sent-id
- (gnorb-registry-make-entry
- sent-id
- (plist-get gnorb-gnus-message-info :from)
- (plist-get gnorb-gnus-message-info :subject)
- (org-id-get-create)
- (plist-get gnorb-gnus-message-info :group)))
- (setq action (cond ((not
- (or (and ret-dest-todo
- (null gnorb-org-mail-todos))
- (member ret-dest-todo gnorb-org-mail-todos)))
- 'note)
- ((eq gnorb-trigger-todo-default 'prompt)
- (intern (completing-read
- "Take note, or trigger TODO state change? "
- '("note" "todo") nil t)))
- ((null arg)
- gnorb-trigger-todo-default)
- (t
- (if (eq gnorb-trigger-todo-default 'todo)
- 'note
- 'todo))))
- (map-y-or-n-p
- (lambda (a)
- (format "Attach %s to heading? "
- (file-name-nondirectory a)))
- (lambda (a) (org-attach-attach a nil 'mv))
- gnorb-gnus-capture-attachments
- '("file" "files" "attach"))
- (setq gnorb-gnus-capture-attachments nil)
- (if (eq action 'note)
- (call-interactively note-func)
- (call-interactively todo-func)))))
+ (gnorb-registry-make-entry
+ (plist-get gnorb-gnus-message-info :msg-id)
+ (plist-get gnorb-gnus-message-info :from)
+ (plist-get gnorb-gnus-message-info :subject)
+ (org-with-point-at root-marker
+ (org-id-get-create))
+ (plist-get gnorb-gnus-message-info :group))
+ (setq action (cond ((not
+ (or (and ret-dest-todo
+ (null gnorb-org-mail-todos))
+ (member ret-dest-todo gnorb-org-mail-todos)))
+ 'note)
+ ((eq gnorb-trigger-todo-default 'prompt)
+ (intern (completing-read
+ "Take note, or trigger TODO state change? "
+ '("note" "todo") nil t)))
+ ((null arg)
+ gnorb-trigger-todo-default)
+ (t
+ (if (eq gnorb-trigger-todo-default 'todo)
+ 'note
+ 'todo))))
+ (map-y-or-n-p
+ (lambda (a)
+ (format "Attach %s to heading? "
+ (file-name-nondirectory a)))
+ (lambda (a) (org-attach-attach a nil 'mv))
+ gnorb-gnus-capture-attachments
+ '("file" "files" "attach"))
+ (setq gnorb-gnus-capture-attachments nil)
+ (if (eq action 'note)
+ (call-interactively note-func)
+ (call-interactively todo-func))))
(defun gnorb-pretty-outline (id &optional kw)
"Return pretty outline path of the Org heading indicated by ID.
- [elpa] externals/gnorb 880afd6 158/449: Register sent messages so we can view them later, (continued)
- [elpa] externals/gnorb 880afd6 158/449: Register sent messages so we can view them later, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 25aa0f1 173/449: Use a marker in conjunction with window conf, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb e1129e9 170/449: Fix problems when BBDB is not present and gnorb-bbdb is not loaded., Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 5f96b98 167/449: Stupid typo, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 9a2f747 175/449: Don't hint messages in nnir or virtual summaries, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb ec44a6d 182/449: Continue shifting candidate finding to the registry, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 927e401 184/449: New function for restoring window layout, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb a352586 189/449: Improve lookups for entries with unknown groups, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 81fed4b 193/449: Helper function for transitioning to the new system, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb d7327b5 192/449: The big switch! Rely only on registry for tracking, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 7ba1786 196/449: Use gnorb-gnus-message-info for incoming and outgoing,
Stefan Monnier <=
- [elpa] externals/gnorb 0cb4d1a 201/449: Docstring for gnorb-scan-links, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 5c9ef6e 203/449: Don't create Org IDs when scanning for mails, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 9ac84b7 218/449: Return links in the order which they were found, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb a9535ae 223/449: Merge branch 'registry', Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb dd4e013 225/449: Restore action shouldn't quit summary buffer, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 08e0742 229/449: Empty News and gnorb.texi files, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb bcfd501 236/449: gitignore Elpa-generated stuff, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 55a630d 238/449: Gnus hinting needs to check in-reply-to as well, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb d2831b8 237/449: Refactor summary buffer hinting into separate function, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 2be4a71 240/449: Save point with marker when adding headers to replies, Stefan Monnier, 2020/11/27