[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnorb 821a6b2 289/449: Allow bulk association of messag
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnorb 821a6b2 289/449: Allow bulk association of messages |
Date: |
Fri, 27 Nov 2020 23:15:57 -0500 (EST) |
branch: externals/gnorb
commit 821a6b29e58a7c43263db96e866d3b4df3fd9cc7
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>
Allow bulk association of messages
* gnorb-gnus.el (gnorb-gnus-incoming-do-todo): This function now
respects Gnus' "work articles" concept, allowing users to mark
multiple messages and bulk associate.
---
gnorb-gnus.el | 55 +++++++++++++++++++++++++++++++++++++++----------------
1 file changed, 39 insertions(+), 16 deletions(-)
diff --git a/gnorb-gnus.el b/gnorb-gnus.el
index 63c2c34..3519c6b 100644
--- a/gnorb-gnus.el
+++ b/gnorb-gnus.el
@@ -491,7 +491,13 @@ If you've set up message tracking \(with
you probably want to trigger, which can save some time. It does
this by looking in the References header, and seeing if any of
the messages referenced there are already being tracked by any
-headings."
+headings.
+
+If you mark several messages before calling this function, or
+call it with a numerical prefix arg, those messages will be
+\"bulk associated\" with the chosen Org heading: associations
+will be made, but you won't be prompted to trigger an action, and
+you'll stay in the Gnus summary buffer."
(interactive "P")
(when (not (memq major-mode '(gnus-summary-mode gnus-article-mode)))
(user-error "Only works in gnus summary or article mode"))
@@ -501,7 +507,8 @@ headings."
(setq gnorb-window-conf (current-window-configuration))
(move-marker gnorb-return-marker (point))
(setq gnorb-gnus-message-info nil)
- (let* ((art-no (gnus-summary-article-number))
+ (let* ((articles (gnus-summary-work-articles arg))
+ (art-no (gnus-summary-article-number))
(headers (gnus-data-header
(gnus-data-find art-no)))
(msg-id (mail-header-id headers))
@@ -528,11 +535,10 @@ headings."
:link ,link :date ,date :refs ,ref-msg-ids
:group ,group))
(gnorb-gnus-collect-all-attachments nil t)
- ;; Delete other windows, users can restore with
- ;; `gnorb-restore-layout'.
- (delete-other-windows)
(if id
- (gnorb-trigger-todo-action arg id)
+ (progn
+ (delete-other-windows)
+ (gnorb-trigger-todo-action nil id))
;; Flush out zombies (dead associations).
(setq related-headings
(cl-remove-if
@@ -544,18 +550,35 @@ headings."
h))
(gnorb-delete-association msg-id h))))
related-headings))
- (if (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)))))
- (gnorb-trigger-todo-action arg targ)
+ ;; 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))
- (find-file (nth 1 targ))
- (goto-char (nth 3 targ))
- (gnorb-trigger-todo-action arg)))))
+ (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)))))
;;;###autoload
(defun gnorb-gnus-search-messages (str &optional ret)
- [elpa] externals/gnorb babfa5c 393/449: Fix to after capture function, bump to 1.3.4, (continued)
- [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, 2020/11/27
- [elpa] externals/gnorb 821a6b2 289/449: Allow bulk association of messages,
Stefan Monnier <=
- [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
- [elpa] externals/gnorb 160f43a 309/449: New function for returning all tracked messages, Stefan Monnier, 2020/11/27