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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/gnorb 4b8a6da 255/449: New function for removing messag


From: Stefan Monnier
Subject: [elpa] externals/gnorb 4b8a6da 255/449: New function for removing message/heading association
Date: Fri, 27 Nov 2020 23:15:50 -0500 (EST)

branch: externals/gnorb
commit 4b8a6da7d8707b5d501bfeeb9e3c3f41e2346871
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>

    New function for removing message/heading association
    
    * gnorb-registry.el (gnorb-delete-association): New function, delete
      association between message and Org heading.
---
 gnorb-registry.el | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gnorb-registry.el b/gnorb-registry.el
index 0eee32c..f775b2d 100644
--- a/gnorb-registry.el
+++ b/gnorb-registry.el
@@ -127,6 +127,16 @@ relevant to that message."
            (setq ret-val (append sub-val ret-val))))))
     (delete-dups ret-val)))
 
+(defun gnorb-delete-association (msg-id org-id)
+  "Disassociate a message and a headline.
+
+This removes an Org heading's ORG-ID from the 'gnorb-ids key of
+the MSG-ID."
+  (let ((org-ids (gnus-registry-get-id-key msg-id 'gnorb-ids)))
+    (when (member org-id org-ids)
+      (gnus-registry-set-id-key msg-id 'gnorb-ids
+                               (remove org-id org-ids)))))
+
 (defun gnorb-registry-org-id-search (id)
   "Find all messages that have the org ID in their 'gnorb-ids
 key."



reply via email to

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