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

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

[elpa] externals/gnorb e1dae56 430/449: [gnorb] Only output summary-line


From: Stefan Monnier
Subject: [elpa] externals/gnorb e1dae56 430/449: [gnorb] Only output summary-line info if registry exists, bump
Date: Fri, 27 Nov 2020 23:16:26 -0500 (EST)

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

    [gnorb] Only output summary-line info if registry exists, bump
    
    See Emacs bug #36903
    
    * packages/gnorb/gnorb-gnus.el (gnorb-gnus-insert-format-letter-maybe):
      (gnorb-gnus-insert-format-tags): Don't access the registry if it's
      not been initialized. See bug report for corner case.
    * packages/gnorb/gnorb.el: Bump to 1.6.2.
---
 gnorb-gnus.el | 52 ++++++++++++++++++++++++++++------------------------
 gnorb.el      |  2 +-
 2 files changed, 29 insertions(+), 25 deletions(-)

diff --git a/gnorb-gnus.el b/gnorb-gnus.el
index a531002..15c83b5 100644
--- a/gnorb-gnus.el
+++ b/gnorb-gnus.el
@@ -986,21 +986,23 @@ 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 (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 " ")))
-    " "))
+  (if (hash-table-p gnus-registry-db)
+      (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 " ")))
+       " ")
+    ""))
 
 (defalias (intern (concat "gnus-user-format-function-"
                          gnorb-gnus-summary-mark-format-letter))
@@ -1008,15 +1010,17 @@ option `gnorb-gnus-hint-relevant-article' is non-nil."
     (gnorb-gnus-insert-format-letter-maybe header)))
 
 (defun gnorb-gnus-insert-format-tags (header)
-  (let* ((id (mail-header-message-id header))
-        (entry (nth 1 (assoc id (registry-lookup
-                                 gnus-registry-db
-                                 (list id)))))
-        (tags (cdr-safe (assq 'org-tags entry))))
-    (if tags
-       (concat
-        ":" (mapconcat #'identity tags ":") ":")
-      "")))
+  (if (hash-table-p gnus-registry-db)
+      (let* ((id (mail-header-message-id header))
+            (entry (nth 1 (assoc id (registry-lookup
+                                     gnus-registry-db
+                                     (list id)))))
+            (tags (cdr-safe (assq 'org-tags entry))))
+       (if tags
+           (concat
+            ":" (mapconcat #'identity tags ":") ":")
+         ""))
+    ""))
 
 (defalias (intern (concat "gnus-user-format-function-"
                          gnorb-gnus-summary-tags-format-letter))
diff --git a/gnorb.el b/gnorb.el
index a872377..0253673 100644
--- a/gnorb.el
+++ b/gnorb.el
@@ -2,7 +2,7 @@
 
 ;; Copyright (C) 2018  Free Software Foundation, Inc.
 
-;; Version: 1.6.1
+;; Version: 1.6.2
 ;; Package-Requires: ((cl-lib "0.5"))
 
 ;; Maintainer: Eric Abrahamsen <eric@ericabrahamsen.net>



reply via email to

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