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

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

[elpa] externals/gnorb 16f1ab6 183/449: Make gnorb-registry-make-entry m


From: Stefan Monnier
Subject: [elpa] externals/gnorb 16f1ab6 183/449: Make gnorb-registry-make-entry more careful
Date: Fri, 27 Nov 2020 23:15:35 -0500 (EST)

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

    Make gnorb-registry-make-entry more careful
    
    * lisp/gnorb-registry.el (gnorb-registry-make-entry): If the entry
      already exists, don't overwrite existing key values with nil values
      passed to this function.
---
 lisp/gnorb-registry.el | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/lisp/gnorb-registry.el b/lisp/gnorb-registry.el
index 7304a8f..95f24c5 100644
--- a/lisp/gnorb-registry.el
+++ b/lisp/gnorb-registry.el
@@ -68,12 +68,17 @@ sent. Save the relevant Org ids in the 'gnorb-ids key."
   ;; inefficient.
   (when gnorb-tracking-enabled
     (gnus-registry-get-or-make-entry msg-id)
-    (gnus-registry-set-id-key msg-id 'sender (list sender))
-    (gnus-registry-set-id-key msg-id 'subject (list subject))
-    (gnus-registry-set-id-key msg-id 'gnorb-ids (if (stringp org-id)
-                                                   (list org-id)
-                                                 org-id))
-    (gnus-registry-set-id-key msg-id 'group (list group))))
+    (when sender
+      (gnus-registry-set-id-key msg-id 'sender (list sender)))
+    (when subject
+      (gnus-registry-set-id-key msg-id 'subject (list subject)))
+    (when org-id
+      (let ((ids (gnus-registry-get-id-key msg-id 'gnorb-ids)))
+       (gnus-registry-set-id-key msg-id 'gnorb-ids (if (stringp org-id)
+                                                       (cons org-id ids)
+                                                     (append org-id ids)))))
+    (when group
+      (gnus-registry-set-id-key msg-id 'group (list group)))))
 
 (defun gnorb-registry-capture ()
   "When capturing from a Gnus message, add our new Org heading id



reply via email to

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