[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnorb 8623bd0 439/449: [gnorb] Further avoid creating r
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnorb 8623bd0 439/449: [gnorb] Further avoid creating registry entries, bump to 1.6.7 |
Date: |
Fri, 27 Nov 2020 23:16:28 -0500 (EST) |
branch: externals/gnorb
commit 8623bd0c910c0be91e45fac167179ee7a201f074
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
[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.
---
gnorb-gnus.el | 27 +++++++++------------------
gnorb-registry.el | 10 +++++++++-
gnorb.el | 2 +-
3 files changed, 19 insertions(+), 20 deletions(-)
diff --git a/gnorb-gnus.el b/gnorb-gnus.el
index fff23a0..5b54248 100644
--- a/gnorb-gnus.el
+++ b/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/gnorb-registry.el b/gnorb-registry.el
index 22d303e..ea3f779 100644
--- a/gnorb-registry.el
+++ b/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/gnorb.el b/gnorb.el
index 8a9cf45..1f3421b 100644
--- a/gnorb.el
+++ b/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 <eric@ericabrahamsen.net>
- [elpa] externals/gnorb 30a6171 404/449: Factor out function for finding nngnorb server, (continued)
- [elpa] externals/gnorb 30a6171 404/449: Factor out function for finding nngnorb server, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb ccf7847 443/449: [gnorb] Check for live Gnus before searching messages, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 15a38e9 423/449: gnorb: More guards for visiting an original Org capture buffer, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 5261d2f7 407/449: New gnorb-helm file, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 5fbc25e 395/449: Gnorb: Re-work the capture hook functions., Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 1f71a97 408/449: Update copyright notices, bump to version 1.5, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 0b503b4 436/449: [gnorb] Update copyright years, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 03ba6e5 412/449: [gnorb] Don't use make-temp-name for registry searches, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 5bac9a7 428/449: [gnorb] Compiler-complaint fixes, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 0856e48 446/449: [gnorb] Add code path for users with nnselect available, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 8623bd0 439/449: [gnorb] Further avoid creating registry entries, bump to 1.6.7,
Stefan Monnier <=
- [elpa] externals/gnorb bd97393 420/449: gnorb: Fix bug in post-message-send action triggering, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 71cf0ef 403/449: Allow short-circuiting the nnir search, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 6d88203 432/449: [gnorb] Add a gnus-shutdown to clean up gnorb hooks, bump to 1.6.4, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 2ca09f4 421/449: gnorb: Fix link following, bump to 1.5.6, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 86b870f 429/449: [gnorb] Replace gnus-buffer-exists-p with gnus-buffer-live-p, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 4bb8cd2 413/449: [gnorb] Check message-alternative-emails in helm registry search, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 840093b 411/449: [gnorb] Don't use string-trim with optional args, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 5e8b0c2 414/449: [gnorb] Fix handling of region-bounds return value, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 183cf9c 435/449: [gnorb] Fix dumb typo in 07214d9e4, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb f383a7e 416/449: [gnorb] Require gnorb-org within gnorb-trigger-todo-action, Stefan Monnier, 2020/11/27