[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnorb c3279d2 284/449: Fix tracking messages from virtu
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnorb c3279d2 284/449: Fix tracking messages from virtual groups |
Date: |
Fri, 27 Nov 2020 23:15:56 -0500 (EST) |
branch: externals/gnorb
commit c3279d2b945edb11ac291db6cec5e3c09346b1d0
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>
Fix tracking messages from virtual groups
* gnorb-utils.el (gnorb-get-real-group-name): New function for finding
the original group name of messages in nnvirtual or nnir groups.
* gnorb-gnus.el (gnorb-gnus-incoming-do-todo): Use new function.
* gnorb-bbdb.el (gnorb-bbdb-store-message-link): Use new function.
Previously, triggering headings from messages in nnvirtual/nnir groups
would create registry entries with 'group keys pointing to the ephemeral
group name. Now we find the real group name before creating the entry.
---
gnorb-bbdb.el | 12 +++---------
gnorb-gnus.el | 10 ++++++----
gnorb-utils.el | 10 ++++++++++
3 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/gnorb-bbdb.el b/gnorb-bbdb.el
index 08f24eb..f774a5f 100644
--- a/gnorb-bbdb.el
+++ b/gnorb-bbdb.el
@@ -591,16 +591,10 @@ to a message into the record's
`gnorb-bbdb-messages-field'."
(parse-time-string (mail-header-date heads))))
(subject (mail-header-subject heads))
(id (mail-header-id heads))
- (group gnus-newsgroup-name)
+ (group (gnorb-get-real-group-name
+ gnus-newsgroup-name
+ art-no))
link)
- ;; check for both nnvirtual and nnir, and link to the real
- ;; group in those cases
- (when (eq (car (gnus-find-method-for-group group))
- 'nnvirtual)
- (setq group (car (nnvirtual-map-article art-no))))
- (when (eq (car (gnus-find-method-for-group group))
- 'nnir)
- (setq group (nnir-article-group art-no)))
(if (not (and date subject id group))
(message "Could not save a link to this message")
(setq link (make-gnorb-bbdb-link :subject subject :date date
diff --git a/gnorb-gnus.el b/gnorb-gnus.el
index a0a91f3..63c2c34 100644
--- a/gnorb-gnus.el
+++ b/gnorb-gnus.el
@@ -501,15 +501,17 @@ headings."
(setq gnorb-window-conf (current-window-configuration))
(move-marker gnorb-return-marker (point))
(setq gnorb-gnus-message-info nil)
- (let* ((headers (gnus-data-header
- (gnus-data-find
- (gnus-summary-article-number))))
+ (let* ((art-no (gnus-summary-article-number))
+ (headers (gnus-data-header
+ (gnus-data-find art-no)))
(msg-id (mail-header-id headers))
(from (mail-header-from headers))
(subject (mail-header-subject headers))
(date (mail-header-date headers))
(to (cdr (assoc 'To (mail-header-extra headers))))
- (group gnus-newsgroup-name)
+ (group (gnorb-get-real-group-name
+ gnus-newsgroup-name
+ art-no))
(link (call-interactively 'org-store-link))
(org-refile-targets gnorb-gnus-trigger-refile-targets)
(ref-msg-ids (concat (mail-header-references headers) " "
diff --git a/gnorb-utils.el b/gnorb-utils.el
index 59794ac..ceeb695 100644
--- a/gnorb-utils.el
+++ b/gnorb-utils.el
@@ -385,6 +385,16 @@ child headings."
;; Common functions for extracting references and relevant headings
;; from the message under point. For use in gnorb-gnus.el functions.
+(defun gnorb-get-real-group-name (group art-no)
+ "Find the original group name of a message in a virtual or nnir
+group."
+ (cl-case (car (gnus-find-method-for-group group))
+ (nnvirtual
+ (setq group (car (nnvirtual-map-article art-no))))
+ (nnir
+ (setq group (nnir-article-group art-no))))
+ group)
+
(defun gnorb-find-tracked-headings (headers &optional include-zombies)
"Check HEADERS for message references and return relevant heading IDs.
- [elpa] externals/gnorb 8e705ea3 380/449: Sneakily add basic EBDB support to Gnorb, bump to 1.3.0, (continued)
- [elpa] externals/gnorb 8e705ea3 380/449: Sneakily add basic EBDB support to Gnorb, bump to 1.3.0, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 4b5a5a1 389/449: Gnorb: Tweak manual a bit, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 5672545 396/449: Gnorb: Typo, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 14ac82a 418/449: [gnorb] Use unwind-protect around the trigger process, bump to 1.5.4, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 471883d 394/449: Gnorb: Only add one registry-related hook to the Org capture process, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb babfa5c 393/449: Fix to after capture function, bump to 1.3.4, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb a6916b6 402/449: Allow gnorb-msg-id-request-head to accept a "group" argument, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb a1c8f0e 417/449: [gnorb] Small gnorb-org bugs, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 034f10a 434/449: [gnorb] Use characterp, not numberp, for testing register key, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb e1dae56 430/449: [gnorb] Only output summary-line info if registry exists, bump, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb c3279d2 284/449: Fix tracking messages from virtual groups,
Stefan Monnier <=
- [elpa] externals/gnorb 41c6778 286/449: nngnorb should be a virtual server, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 6e6ee46 285/449: Zap another with-eval-after-load, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 09679fa 287/449: Misspelled function name, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb f585c03 290/449: condition-case the incoming trigger process, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 821a6b2 289/449: Allow bulk association of messages, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 9d64acb 292/449: Update gnorb-registry-capture to use convenience funcs, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb cc7d45b 291/449: Be more careful handling org tags on BBDB records, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 84ff7a7 294/449: Don't let attach errors derail the trigger process, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 9c910c9 296/449: Re-raise errors in the triggering process, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb a4089f8 297/449: Fix completing-read in message disassociation, Stefan Monnier, 2020/11/27