emacs-elpa-diffs
[Top][All Lists]
Advanced

[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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]