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

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

[elpa] externals/gnorb 8509773 376/449: Don't let the Gnus summary forma


From: Stefan Monnier
Subject: [elpa] externals/gnorb 8509773 376/449: Don't let the Gnus summary format group create registry entries
Date: Fri, 27 Nov 2020 23:16:15 -0500 (EST)

branch: externals/gnorb
commit 850977345d02c1f331507a3152c4d121044e3418
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    Don't let the Gnus summary format group create registry entries
    
    * packages/gnorb/gnorb-gnus.el (gnorb-gnus-insert-format-letter-maybe):
      This function was unilaterally creating entries because of its use
      of `gnus-regsitry-get-id-key'. Because it does not respect ignored
      registry groups, we should use lower-level functions that don't
      create an entry where there wasn't one.
---
 gnorb-gnus.el | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/gnorb-gnus.el b/gnorb-gnus.el
index e682391..5a75bc0 100644
--- a/gnorb-gnus.el
+++ b/gnorb-gnus.el
@@ -749,15 +749,20 @@ option `gnorb-gnus-hint-relevant-article' is non-nil."
 (add-hook 'gnus-select-article-hook 'gnorb-gnus-hint-relevant-message)
 
 (defun gnorb-gnus-insert-format-letter-maybe (header)
-  (if (not (memq (car (gnus-find-method-for-group
-                      gnus-newsgroup-name))
-                '(nnvirtual nnir)))
-      (cond ((gnus-registry-get-id-key
-             (mail-header-message-id header) 'gnorb-ids)
-            gnorb-gnus-summary-tracked-mark)
-           ((gnorb-find-tracked-headings header)
-            gnorb-gnus-summary-mark)
-           (t " "))
+  (if (not (or (gnus-ephemeral-group-p gnus-newsgroup-name)
+              (gnus-virtual-group-p gnus-newsgroup-name)))
+      (let* ((id (mail-header-message-id header))
+            ;; Use lower-level accessor to avoid creating an entry
+            ;; where there wasn't one.  This function doesn't respect
+            ;; ignored registry groups.
+            (entry (nth 1 (assoc id (registry-lookup
+                                     gnus-registry-db
+                                     (list id))))))
+       (cond ((cdr-safe (assq 'gnorb-ids entry))
+              gnorb-gnus-summary-tracked-mark)
+             ((gnorb-find-tracked-headings header)
+              gnorb-gnus-summary-mark)
+             (t " ")))
     " "))
 
 (fset (intern (concat "gnus-user-format-function-"



reply via email to

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