[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 8a1c448: [gnorb] Further avoid creating registry entries,
From: |
Eric Abrahamsen |
Subject: |
[elpa] master 8a1c448: [gnorb] Further avoid creating registry entries, bump to 1.6.7 |
Date: |
Thu, 30 Apr 2020 13:26:41 -0400 (EDT) |
branch: master
commit 8a1c4487c2217e4aec0414b9738ddcbf924088fe
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
[gnorb] Further avoid creating registry entries, bump to 1.6.7
I fixed half of this problem in 3be2700, Bob Newell pointed out there
were more similar problems.
* packages/gnorb/gnorb-registry.el (gnorb-registry-get-id-key): New
function, equivalent to gnus-registry-get-id-key, but doesn't
unilaterally create a new entry (I don't think the gnus one should,
either).
(gnorb-find-visit-candidates):
* packages/gnorb/gnorb-gnus.el (gnorb-gnus-hint-relevant-message,
gnorb-gnus-insert-format-letter-maybe, gnorb-gnus-insert-format-tags):
Use new function.
---
packages/gnorb/gnorb-gnus.el | 27 +++++++++------------------
packages/gnorb/gnorb-registry.el | 10 +++++++++-
packages/gnorb/gnorb.el | 2 +-
3 files changed, 19 insertions(+), 20 deletions(-)
diff --git a/packages/gnorb/gnorb-gnus.el b/packages/gnorb/gnorb-gnus.el
index fff23a0..5b54248 100644
--- a/packages/gnorb/gnorb-gnus.el
+++ b/packages/gnorb/gnorb-gnus.el
@@ -964,7 +964,7 @@ option `gnorb-gnus-hint-relevant-article' is non-nil."
(gnus-data-find
(gnus-summary-article-number))))
(assoc-heading
- (gnus-registry-get-id-key
+ (gnorb-registry-get-id-key
(gnus-fetch-original-field "message-id") 'gnorb-ids))
(tracked-headings (gnorb-find-tracked-headings headers)))
(cond (assoc-heading
@@ -981,18 +981,12 @@ option `gnorb-gnus-hint-relevant-article' is non-nil."
(if (eieio-object-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 " ")))
+ (cond ((gnorb-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 " "))
" ")
""))
@@ -1003,11 +997,8 @@ option `gnorb-gnus-hint-relevant-article' is non-nil."
(defun gnorb-gnus-insert-format-tags (header)
(if (eieio-object-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))))
+ (let ((tags (gnorb-registry-get-id-key
+ (mail-header-message-id header) 'org-tags)))
(if tags
(concat
":" (mapconcat #'identity tags ":") ":")
diff --git a/packages/gnorb/gnorb-registry.el b/packages/gnorb/gnorb-registry.el
index 55608cb..3adc0cb 100644
--- a/packages/gnorb/gnorb-registry.el
+++ b/packages/gnorb/gnorb-registry.el
@@ -79,6 +79,14 @@ sent. Save the relevant Org ids in the 'gnorb-ids key."
(gnus-registry-set-id-key msg-id 'group (list group)))
(gnus-registry-get-or-make-entry msg-id)))
+(defun gnorb-registry-get-id-key (id key)
+ "Get value of symbol KEY for ID's entry in the registry.
+Works just like `gnus-registry-get-id-key', but doesn't create an
+entry if it doesn't exist already."
+ (cdr-safe
+ (assq key (nth 1 (assoc id (registry-lookup
+ gnus-registry-db (list id)))))))
+
(defun gnorb-registry-capture ()
"When capturing from a Gnus message, add our new Org heading id
to the message's registry entry, under the `gnorb-ids' key."
@@ -115,7 +123,7 @@ even for headings that appear to no longer exist."
(dolist (id ids)
(when
(setq sub-val
- (gnus-registry-get-id-key id 'gnorb-ids))
+ (gnorb-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.
diff --git a/packages/gnorb/gnorb.el b/packages/gnorb/gnorb.el
index b28eeb4..e016d05 100644
--- a/packages/gnorb/gnorb.el
+++ b/packages/gnorb/gnorb.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
-;; Version: 1.6.6
+;; Version: 1.6.7
;; Package-Requires: ((cl-lib "0.5"))
;; Maintainer: Eric Abrahamsen <address@hidden>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] master 8a1c448: [gnorb] Further avoid creating registry entries, bump to 1.6.7,
Eric Abrahamsen <=