[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnorb e1fb666 257/449: Function for deleting all assoca
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnorb e1fb666 257/449: Function for deleting all assocations of an Org heading |
Date: |
Fri, 27 Nov 2020 23:15:51 -0500 (EST) |
branch: externals/gnorb
commit e1fb66628d147d9d05300d8002037d7eb671dc6c
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>
Function for deleting all assocations of an Org heading
* gnorb-registry.el (gnorb-delete-all-assocations): New function. Not
yet used anywhere.
---
gnorb-registry.el | 30 +++++++++++++++++++++++-------
1 file changed, 23 insertions(+), 7 deletions(-)
diff --git a/gnorb-registry.el b/gnorb-registry.el
index 34ea776..b27545e 100644
--- a/gnorb-registry.el
+++ b/gnorb-registry.el
@@ -125,14 +125,16 @@ even for headings that appear to no longer exist."
(progn
(dolist (id ids)
(when
- (and
- (setq sub-val
- (gnus-registry-get-id-key id 'gnorb-ids))
- ;; This lets us be reasonably confident that the
- ;; heading still exists.
- (or include-zombies
- (org-id-find-id-file id)))
+ (setq sub-val
+ (gnus-registry-get-id-key id 'gnorb-ids))
(setq ret-val (append sub-val ret-val))))))
+ ;; This lets us be reasonably confident that the
+ ;; headings still exist.
+ (unless include-zombies
+ (cl-remove-if-not
+ (lambda (org-id)
+ (org-id-find-id-file org-id))
+ ret-val))
(delete-dups ret-val)))
(defun gnorb-delete-association (msg-id org-id)
@@ -145,6 +147,20 @@ the MSG-ID."
(gnus-registry-set-id-key msg-id 'gnorb-ids
(remove org-id org-ids)))))
+(defun gnorb-delete-all-assocations (org-id)
+ "Delete all message associations for an Org heading.
+
+The heading is identified by ORG-ID. This is suitable for use
+after an Org heading is deleted, for instance."
+ (let ((assoc-msgs (gnorb-registry-org-id-search org-id)))
+ (mapcar
+ (lambda (msg-id)
+ (let ((org-ids
+ (gnus-registry-get-id-key msg-id 'gnorb-ids)))
+ (gnus-registry-set-id-key
+ msg-id 'gnorb-ids (remove org-id org-ids))))
+ assoc-msgs)))
+
(defun gnorb-registry-org-id-search (id)
"Find all messages that have the org ID in their 'gnorb-ids
key."
- [elpa] externals/gnorb dd4e013 225/449: Restore action shouldn't quit summary buffer, (continued)
- [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
- [elpa] externals/gnorb ba99110 242/449: Check for relevant headings when handling attachments, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 1a0cfc7 243/449: Delete duplicates before and after finding candidates, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 35284f2 248/449: Add TODO for collecting BBDB messages by thread, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 2c0f43d 249/449: Refinements to link extraction, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb e1fb666 257/449: Function for deleting all assocations of an Org heading,
Stefan Monnier <=
- [elpa] externals/gnorb 5688114 258/449: Bugfix: Adding mailtos to newly-setup messages, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 04ec3ab 264/449: Fix logic of choosing heading to trigger, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb de0dff5 274/449: Protection for message disassociation, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 321b23b 276/449: Remove gnus-interactive, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 8a9c167 277/449: Fix the cl-lib loading stuff, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb fd91084 278/449: Remove incorrect "fix" for Gnus 5.13, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb c8b80c5 282/449: Bugfix for gnorb-gnus-view, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 9220a10 283/449: Docstring fix, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 4b19c83 288/449: New function for pruning dead associations, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 819b1e5 293/449: Suggest binding gnorb-org-view in Org Agenda, Stefan Monnier, 2020/11/27