[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnorb f585c03 290/449: condition-case the incoming trig
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnorb f585c03 290/449: condition-case the incoming trigger process |
Date: |
Fri, 27 Nov 2020 23:15:57 -0500 (EST) |
branch: externals/gnorb
commit f585c03f82e4abeaf0162fd32600341d6715a973
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>
condition-case the incoming trigger process
* gnorb-gnus.el (gnorb-gnus-incoming-do-todo): If anything goes wrong
with the incoming trigger process, we need to zero out
gnorb-gnus-message-info and gnorb-gnus-capture-attachments.
---
gnorb-gnus.el | 94 +++++++++++++++++++++++++++++++----------------------------
1 file changed, 50 insertions(+), 44 deletions(-)
diff --git a/gnorb-gnus.el b/gnorb-gnus.el
index 3519c6b..ba92bc6 100644
--- a/gnorb-gnus.el
+++ b/gnorb-gnus.el
@@ -535,50 +535,56 @@ you'll stay in the Gnus summary buffer."
:link ,link :date ,date :refs ,ref-msg-ids
:group ,group))
(gnorb-gnus-collect-all-attachments nil t)
- (if id
- (progn
- (delete-other-windows)
- (gnorb-trigger-todo-action nil id))
- ;; 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?"
- h))
- (gnorb-delete-association msg-id h))))
- related-headings))
- ;; See if one of the related headings is chosen.
- (unless (catch 'target
- (dolist (h related-headings nil)
- (when (yes-or-no-p
- (format "Trigger action on %s"
- (gnorb-pretty-outline h)))
- (throw 'target (setq targ h)))))
- ;; If not, use the refile interface to choose one.
- (setq targ (org-refile-get-location
- "Trigger heading" nil t))
- (setq targ
- (save-window-excursion
- (find-file (nth 1 targ))
- (goto-char (nth 3 targ))
- (org-id-get-create))))
- ;; Either bulk associate multiple messages...
- (if (> (length articles) 1)
- (progn
- (dolist (a articles)
- (gnorb-registry-make-entry
- (mail-header-id
- (gnus-data-header
- (gnus-data-find a)))
- from subject targ group))
- (message "Associated %d messages with %s"
- (length articles) (gnorb-pretty-outline targ)))
- ;; ...or just trigger the one.
- (delete-other-windows)
- (gnorb-trigger-todo-action nil targ)))))
+ (condition-case nil
+ (if id
+ (progn
+ (delete-other-windows)
+ (gnorb-trigger-todo-action nil id))
+ ;; 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?"
+ h))
+ (gnorb-delete-association msg-id h))))
+ related-headings))
+ ;; See if one of the related headings is chosen.
+ (unless (catch 'target
+ (dolist (h related-headings nil)
+ (when (yes-or-no-p
+ (format "Trigger action on %s"
+ (gnorb-pretty-outline h)))
+ (throw 'target (setq targ h)))))
+ ;; If not, use the refile interface to choose one.
+ (setq targ (org-refile-get-location
+ "Trigger heading" nil t))
+ (setq targ
+ (save-window-excursion
+ (find-file (nth 1 targ))
+ (goto-char (nth 3 targ))
+ (org-id-get-create))))
+ ;; Either bulk associate multiple messages...
+ (if (> (length articles) 1)
+ (progn
+ (dolist (a articles)
+ (gnorb-registry-make-entry
+ (mail-header-id
+ (gnus-data-header
+ (gnus-data-find a)))
+ from subject targ group))
+ (message "Associated %d messages with %s"
+ (length articles) (gnorb-pretty-outline targ)))
+ ;; ...or just trigger the one.
+ (delete-other-windows)
+ (gnorb-trigger-todo-action nil targ)))
+ (error
+ ;; If these are left populated after an error, it plays hell
+ ;; with future trigger processes.
+ (setq gnorb-gnus-message-info nil)
+ (setq gnorb-gnus-capture-attachments nil)))))
;;;###autoload
(defun gnorb-gnus-search-messages (str &optional ret)
- [elpa] externals/gnorb 471883d 394/449: Gnorb: Only add one registry-related hook to the Org capture process, (continued)
- [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, 2020/11/27
- [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 <=
- [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
- [elpa] externals/gnorb 648f5a7 295/449: Remove process mark after bulk association, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 94fe1b8 299/449: Incorporate changes from Stefan M, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb d2e1e11 298/449: Mention registry bugs in README, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 9efae5a 308/449: Fix call to cl-subseq, Stefan Monnier, 2020/11/27