[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnorb 4f302fa 205/449: New gnorb-collect-ids utility fu
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnorb 4f302fa 205/449: New gnorb-collect-ids utility function |
Date: |
Fri, 27 Nov 2020 23:15:40 -0500 (EST) |
branch: externals/gnorb
commit 4f302fa33a96f4ecfff23f4ed4ee67b146dd648b
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>
New gnorb-collect-ids utility function
* lisp/gnorb-utils.el (gnorb-collect-ids): New function
* lisp/nngnorb.el (nnir-run-gnorb): Use new function
---
lisp/gnorb-utils.el | 16 ++++++++++++++++
lisp/nngnorb.el | 6 ++----
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/lisp/gnorb-utils.el b/lisp/gnorb-utils.el
index 49015c3..6ac1c99 100644
--- a/lisp/gnorb-utils.el
+++ b/lisp/gnorb-utils.el
@@ -300,6 +300,22 @@ methods?"
(when (featurep 'notmuch)
nil))))
+(defun gnorb-collect-ids (&optional id)
+ "Collect all Org IDs for a subtree.
+
+Starting with the heading under point (or the heading indicated
+by the ID argument), collect its ID property, and the IDs of all
+child headings."
+ (save-excursion
+ (save-restriction
+ (when id
+ (org-id-goto id))
+ (org-narrow-to-subtree)
+ (org-element-map (org-element-parse-buffer)
+ 'headline
+ (lambda (hl)
+ (org-element-property :ID hl))))))
+
;; Loading the registry
(defvar gnorb-tracking-enabled nil
diff --git a/lisp/nngnorb.el b/lisp/nngnorb.el
index 8b99ac9..2beb224 100644
--- a/lisp/nngnorb.el
+++ b/lisp/nngnorb.el
@@ -92,10 +92,8 @@ be scanned for gnus messages, and those messages displayed."
(org-narrow-to-subtree)
(setq org-ids
(append
- (org-element-map (org-element-parse-buffer)
- 'headline
- (lambda (hl) (org-element-property :ID hl)))
- org-ids)))))
+ (gnorb-collect-ids)
+ org-ids)))))
((listp q)
;; be a little careful: this could be a list of links, or
;; it could be the full plist
- [elpa] externals/gnorb f1545cd 162/449: Don't add a 'group key to registry if no group, (continued)
- [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, 2020/11/27
- [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 <=
- [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
- [elpa] externals/gnorb 01645a4 215/449: Allowing fetching attachments from specific IDs, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 305a704 216/449: Don't append the message-exit-action, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb d0d196f 222/449: Check prefix arg correctly, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 9a76fad 226/449: Use org-element-interpret-data to get paragraph text, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 09346e0 141/449: BBDB message link list needs closing newline, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 69980d3 143/449: Improvements to nnir-run-gnorb, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb ebce811 144/449: Also check for nnir when storing BBDB message links, Stefan Monnier, 2020/11/27