branch: master commit a2c281e26e3988327bf2ee64fc3c2b83f41e02ee Author: Eric Abrahamsen <e...@ericabrahamsen.net> Commit: Eric Abrahamsen <e...@ericabrahamsen.net>
Gnorb: New option gnorb-gnus-tick-all-tracked-messages Fixes #34 * packages/gnorb/gnorb-gnus.el (gnorb-gnus-tick-all-tracked-messages): New option, does what it says. * packages/gnorb/gnorb-gnus.el (gnorb-gnus-incoming-do-todo): Maybe tick messages here. (gnorb-gnus-quick-reply): And here. * packages/gnorb/gnorb.info: Document. --- packages/gnorb/gnorb-gnus.el | 28 ++++++++++++++++++++-------- packages/gnorb/gnorb.info | 10 +++++++--- packages/gnorb/gnorb.org | 3 +++ packages/gnorb/gnorb.texi | 4 ++++ 4 files changed, 34 insertions(+), 11 deletions(-) diff --git a/packages/gnorb/gnorb-gnus.el b/packages/gnorb/gnorb-gnus.el index 0c21b58..abf0739 100644 --- a/packages/gnorb/gnorb-gnus.el +++ b/packages/gnorb/gnorb-gnus.el @@ -110,6 +110,13 @@ register." :group 'gnorb-gnus :type 'boolean) +(defcustom gnorb-gnus-tick-all-tracked-messages nil + "When non-nil, add the tick mark to all tracked messages. +This happens only once, at the time the association is created. +Ticks can be safely removed later." + :group 'gnorb-gnus + :type 'boolean) + (defcustom gnorb-gnus-summary-mark-format-letter "g" "Format letter to be used as part of your `gnus-summary-line-format', to indicate in the *Summary* buffer @@ -528,14 +535,14 @@ work." ;;;###autoload (defun gnorb-gnus-incoming-do-todo (arg &optional id) - "Call this function from a received gnus message to store a -link to the message, prompt for a related Org heading, visit the -heading, and trigger an action on it \(see -`gnorb-org-trigger-actions'\). - -If you've set up message tracking \(with -`gnorb-tracking-initialize'\), Gnorb can guess which Org heading -you probably want to trigger, which can save some time. It does + "Use the message under point to trigger an action on an Org heading. +This function stores a link to the message, prompts for a related +Org heading, visits the heading, and triggers an action on +it (see `gnorb-org-trigger-actions'). + +If you've set up message tracking (with +`gnorb-tracking-initialize'), Gnorb can guess which Org heading +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. @@ -646,6 +653,8 @@ you'll stay in the Gnus summary buffer." (message "Message text copied to kill ring")))) (with-current-buffer buf (dolist (a articles) + (when gnorb-gnus-tick-all-tracked-messages + (gnus-summary-mark-article a gnus-ticked-mark)) (gnus-summary-update-article a)))) (error ;; If these are left populated after an error, it plays hell @@ -686,6 +695,9 @@ reply." (let ((ret (make-marker))) (setq gnorb-window-conf (current-window-configuration)) (move-marker gnorb-return-marker (point)) + (when gnorb-gnus-tick-all-tracked-messages + (gnus-summary-mark-article art-no gnus-ticked-mark)) + (gnus-summary-update-article art-no) ;; Assume the first heading is the one we want. (gnorb-registry-make-entry msg-id from subject targ group) diff --git a/packages/gnorb/gnorb.info b/packages/gnorb/gnorb.info index c1a54f3..0d848db 100644 --- a/packages/gnorb/gnorb.info +++ b/packages/gnorb/gnorb.info @@ -663,6 +663,10 @@ File: gnorb.info, Node: User Options 2, Up: Misc Gnus Treat all capture templates as if they had the :gnus-attachments key set to “t”. This only has any effect if you’re capturing from a Gnus summary or article buffer. +‘gnorb-gnus-tick-all-tracked-messages’ + When non-nil, always add the tick mark to messages when they are + first associated with an Org heading. The mark can be safely + deleted afterwards. ‘gnorb-trigger-todo-default’ Set to either ’note or ’todo to tell ‘gnorb-gnus-incoming-do-todo’ what to do by default. You can reach the non-default behavior by @@ -775,9 +779,9 @@ Node: User Options22106 Node: Misc Org23629 Node: Inserting BBDB links23804 Node: User Options 124060 -Node: Misc Gnus26958 -Node: User Options 227120 -Node: Default Keybindings30057 +Node: Misc Gnus26774 +Node: User Options 226936 +Node: Default Keybindings30078 End Tag Table diff --git a/packages/gnorb/gnorb.org b/packages/gnorb/gnorb.org index b3f71fd..1d77eae 100644 --- a/packages/gnorb/gnorb.org +++ b/packages/gnorb/gnorb.org @@ -464,6 +464,9 @@ insert an Org link to that record at point. if they had the :gnus-attachments key set to "t". This only has any effect if you're capturing from a Gnus summary or article buffer. +- `gnorb-gnus-tick-all-tracked-messages' :: When non-nil, always add + the tick mark to messages when they are first associated with an + Org heading. The mark can be safely deleted afterwards. - `gnorb-trigger-todo-default' :: Set to either 'note or 'todo to tell `gnorb-gnus-incoming-do-todo' what to do by default. You can reach the non-default behavior by calling that function with a diff --git a/packages/gnorb/gnorb.texi b/packages/gnorb/gnorb.texi index a4b3f09..6c6485c 100644 --- a/packages/gnorb/gnorb.texi +++ b/packages/gnorb/gnorb.texi @@ -653,6 +653,10 @@ Treat all capture templates as if they had the :gnus-attachments key set to ``t''. This only has any effect if you're capturing from a Gnus summary or article buffer. +@item `gnorb-gnus-tick-all-tracked-messages' +When non-nil, always add +the tick mark to messages when they are first associated with an +Org heading. The mark can be safely deleted afterwards. @item `gnorb-trigger-todo-default' Set to either 'note or 'todo to tell `gnorb-gnus-incoming-do-todo' what to do by default. You can