[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnorb eaa4bf4 181/449: Begin shifting candidate finding
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnorb eaa4bf4 181/449: Begin shifting candidate finding to the registry |
Date: |
Fri, 27 Nov 2020 23:15:34 -0500 (EST) |
branch: externals/gnorb
commit eaa4bf445a0f6176ec5bd31b7f200c21a1d47ccb
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>
Begin shifting candidate finding to the registry
* lisp/gnorb-org.el (gnorb-org-find-visit-candidates): Remove function
* lisp/gnorb-registry.el (gnorb-find-visit-candidates): New function name
* lisp/gnorb-gnus.el: Change all calls to new function
---
lisp/gnorb-gnus.el | 12 ++++++------
lisp/gnorb-org.el | 13 -------------
lisp/gnorb-registry.el | 13 +++++++++++++
3 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/lisp/gnorb-gnus.el b/lisp/gnorb-gnus.el
index 0d33c9e..69602ab 100644
--- a/lisp/gnorb-gnus.el
+++ b/lisp/gnorb-gnus.el
@@ -332,7 +332,7 @@ work."
;; handled when the message was sent.
(progn (when (stringp ref-ids)
(setq ref-ids (split-string ref-ids)))
- (setq rel-headings (gnorb-org-find-visit-candidates
ref-ids))
+ (setq rel-headings (gnorb-find-visit-candidates ref-ids))
(if (not rel-headings)
(gnorb-gnus-outgoing-make-todo-1)
(dolist (h rel-headings)
@@ -371,7 +371,7 @@ work."
(setq ref-ids (split-string ref-ids)))
;; if the References header points to any message ids that are
;; tracked by TODO headings...
- (setq rel-headings (gnorb-org-find-visit-candidates ref-ids)))
+ (setq rel-headings (gnorb-find-visit-candidates ref-ids)))
(when rel-headings
(goto-char (point-min))
(dolist (h rel-headings)
@@ -493,7 +493,7 @@ to t (it is, by default)."
;; for now we're basically ignoring the fact that
;; multiple candidates could exist; just do the first
;; one.
- (car (gnorb-org-find-visit-candidates
+ (car (gnorb-find-visit-candidates
ref-msg-ids))
(message "Gnorb can't check for relevant headings unless
`org-id-track-globally' is t")
(sit-for 1))))
@@ -587,7 +587,7 @@ option `gnorb-gnus-hint-relevant-article' is non-nil."
(when ref-ids
(setq ref-ids (split-string ref-ids))
(when (setq rel-headings
- (gnorb-org-find-visit-candidates ref-ids))
+ (gnorb-find-visit-candidates ref-ids))
(message "Possible relevant todo (%s): %s, trigger with %s"
(org-with-point-at (org-id-find
(caar rel-headings) t)
@@ -606,7 +606,7 @@ option `gnorb-gnus-hint-relevant-article' is non-nil."
(lambda (header)
(let ((ref-ids (mail-header-references header)))
(if (and ref-ids
- (gnorb-org-find-visit-candidates
+ (gnorb-find-visit-candidates
(split-string ref-ids)))
gnorb-gnus-summary-mark
" "))))
@@ -624,7 +624,7 @@ option `gnorb-gnus-hint-relevant-article' is non-nil."
rel-headings)
(when refs
(setq refs (split-string refs))
- (setq rel-headings (gnorb-org-find-visit-candidates refs))
+ (setq rel-headings (gnorb-find-visit-candidates refs))
(delete-other-windows)
(org-id-goto (caar rel-headings)))))
diff --git a/lisp/gnorb-org.el b/lisp/gnorb-org.el
index e064fc2..fa08264 100644
--- a/lisp/gnorb-org.el
+++ b/lisp/gnorb-org.el
@@ -606,19 +606,6 @@ current heading."
gnorb-org-find-candidates-match
'agenda 'archive 'comment)))
-(defun gnorb-org-find-visit-candidates (ids)
- "For all message-ids in IDS (which should be a list of
-Message-ID strings, with angle brackets), produce a list of Org
-ids (and ol-paths) for headings that contain one of those id
-values in their `gnorb-org-org-msg-id-key' property."
- (let (ret-val sub-val)
- (unless gnorb-msg-id-to-heading-table
- (gnorb-org-populate-id-hash))
- (dolist (id ids)
- (when (setq sub-val (gethash id gnorb-msg-id-to-heading-table))
- (setq ret-val (append sub-val ret-val))))
- ret-val))
-
;;; Email subtree
(defcustom gnorb-org-email-subtree-text-parameters nil
diff --git a/lisp/gnorb-registry.el b/lisp/gnorb-registry.el
index 8b47dcb..ff5e47e 100644
--- a/lisp/gnorb-registry.el
+++ b/lisp/gnorb-registry.el
@@ -86,4 +86,17 @@ to the message's registry entry, under the 'gnorb-ids key."
(setq org-ids (delete-dups org-ids))
(gnus-registry-set-id-key msg-id 'gnorb-ids org-ids))))
+(defun gnorb-find-visit-candidates (ids)
+ "For all message-ids in IDS (which should be a list of
+Message-ID strings, with angle brackets), produce a list of Org
+ids (and ol-paths) for headings that contain one of those id
+values in their `gnorb-org-org-msg-id-key' property."
+ (let (ret-val sub-val)
+ (unless gnorb-msg-id-to-heading-table
+ (gnorb-org-populate-id-hash))
+ (dolist (id ids)
+ (when (setq sub-val (gethash id gnorb-msg-id-to-heading-table))
+ (setq ret-val (append sub-val ret-val))))
+ ret-val))
+
(provide 'gnorb-registry)
- [elpa] externals/gnorb ecf161e 154/449: Use copy-sequence on message-mode-hook!, (continued)
- [elpa] externals/gnorb ecf161e 154/449: Use copy-sequence on message-mode-hook!, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb fc9b6cf 153/449: Use existing functions for mime handles, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb f3b9fad 161/449: Split out msg-id to group/link functionality, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb a509ff6 164/449: Still trying to track outgoing messages, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb ade7ee8 163/449: Make hash entries for new sent-message TODOs, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 4d584f1 171/449: Require gnorb-bbdb when popping up bbdb buffer, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 260161b 159/449: Check registry-enabled only after registry is loaded, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb f1545cd 162/449: Don't add a 'group key to registry if no group, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb d04bf53 178/449: Rename/move the registry-entry function, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 452a3f0 177/449: Basic skeleton of registry usage, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb eaa4bf4 181/449: Begin shifting candidate finding to the registry,
Stefan Monnier <=
- [elpa] externals/gnorb 7f4dbed 180/449: Don't check for relevant headings if not tracking, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 093c4ed 185/449: Spurious 'g', Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 8121bf5 188/449: Stop creating hash table entries and GNORB_MSG_IDS, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 7b70966 190/449: Look up tracked messages via the registry, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 5ba511e 198/449: Dispense with the "insert a link" message, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 05e6a02 204/449: Docstring for gnorb-msg-id-to-link, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 4f302fa 205/449: New gnorb-collect-ids utility function, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 01e7b1e 206/449: New minor mode for nnir summary buffers, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 69ddfd3 212/449: Delete duplicate org-ids for outgoing messages, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 36303d9 213/449: Do a better job of dealing with reference headers, Stefan Monnier, 2020/11/27