[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnorb 04ec3ab 264/449: Fix logic of choosing heading to
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnorb 04ec3ab 264/449: Fix logic of choosing heading to trigger |
Date: |
Fri, 27 Nov 2020 23:15:52 -0500 (EST) |
branch: externals/gnorb
commit 04ec3ab48e96a570482112130a80d6585515a246
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>
Fix logic of choosing heading to trigger
* gnorb-gnus.el (gnorb-gnus-incoming-do-todo): Need to do several things
at once: check for dead associations and delete them if necessary,
then go through all the possible relevant headings and find the one
the user wants to trigger.
---
gnorb-gnus.el | 29 ++++++++++++++++++-----------
1 file changed, 18 insertions(+), 11 deletions(-)
diff --git a/gnorb-gnus.el b/gnorb-gnus.el
index a793c0d..88714d7 100644
--- a/gnorb-gnus.el
+++ b/gnorb-gnus.el
@@ -509,6 +509,8 @@ to t (it is, by default)."
msg-id))
(related-headings
(when (and (null id) ref-msg-ids)
+ ;; Specifically ask for zombies, so the user has chance to
+ ;; flush them out.
(gnorb-find-tracked-headings headers t)))
targ)
(setq gnorb-gnus-message-info
@@ -522,19 +524,25 @@ to t (it is, by default)."
(delete-other-windows)
(if id
(gnorb-trigger-todo-action arg id)
- (if (and related-headings
- (while (and
- (null (org-id-find-id-file
- (setq targ (pop related-headings))))
- targ)
+ ;; Flush out zombies (dead associations).
+ (setq related-headings
+ (cl-remove-if
+ (lambda (h)
+ (when (null (org-id-find-id-file h))
(when (y-or-n-p
(format
"ID %s no longer exists, disassociate message?"
targ))
- (gnorb-delete-association msg-id targ)))
- (y-or-n-p (format "Trigger action on %s"
- (gnorb-pretty-outline
- targ))))
+ (gnorb-delete-association msg-id targ))))
+ related-headings))
+ (if (catch 'target
+ (mapcar
+ (lambda (h)
+ (when (yes-or-no-p
+ (format "Trigger action on %s"
+ (gnorb-pretty-outline h)))
+ (throw 'target (setq targ h))))
+ related-headings))
(gnorb-trigger-todo-action arg targ)
(setq targ (org-refile-get-location
"Trigger heading" nil t))
@@ -577,8 +585,7 @@ work."
(list 'nnir nnir-address)
(list 'nnir "nnir"))
nil
- ret ;; it's possible you can't just put an arbitrary form in
- ;; here, which sucks.
+ ret
nil nil
;; the following seems to simply be ignored under gnus 5.13
(list (cons 'nnir-specs (list (cons 'nnir-query-spec `((query . ,str)))
- [elpa] externals/gnorb bcfd501 236/449: gitignore Elpa-generated stuff, (continued)
- [elpa] externals/gnorb bcfd501 236/449: gitignore Elpa-generated stuff, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 55a630d 238/449: Gnus hinting needs to check in-reply-to as well, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb d2831b8 237/449: Refactor summary buffer hinting into separate function, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 2be4a71 240/449: Save point with marker when adding headers to replies, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb ba99110 242/449: Check for relevant headings when handling attachments, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 1a0cfc7 243/449: Delete duplicates before and after finding candidates, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 35284f2 248/449: Add TODO for collecting BBDB messages by thread, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 2c0f43d 249/449: Refinements to link extraction, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb e1fb666 257/449: Function for deleting all assocations of an Org heading, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 5688114 258/449: Bugfix: Adding mailtos to newly-setup messages, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 04ec3ab 264/449: Fix logic of choosing heading to trigger,
Stefan Monnier <=
- [elpa] externals/gnorb de0dff5 274/449: Protection for message disassociation, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 321b23b 276/449: Remove gnus-interactive, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 8a9c167 277/449: Fix the cl-lib loading stuff, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb fd91084 278/449: Remove incorrect "fix" for Gnus 5.13, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb c8b80c5 282/449: Bugfix for gnorb-gnus-view, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 9220a10 283/449: Docstring fix, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 4b19c83 288/449: New function for pruning dead associations, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 819b1e5 293/449: Suggest binding gnorb-org-view in Org Agenda, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb c13f4df 301/449: Better check for capture cleanup, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 13bb840 302/449: Hint which heading will be triggered, Stefan Monnier, 2020/11/27