[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnorb 9e880eb 200/449: Improve Gnus summary hinting
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnorb 9e880eb 200/449: Improve Gnus summary hinting |
Date: |
Fri, 27 Nov 2020 23:15:38 -0500 (EST) |
branch: externals/gnorb
commit 9e880eb3c7e6845c85c534ca7b46d9172831daaa
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>
Improve Gnus summary hinting
* lisp/gnorb-gnus.el (gnorb-gnus-hint-relevant-message): Only hint if
tracking is enabled. Also, hint both for messages that are replies to
tracked messages, and messages that are tracked themselves.
(gnus-user-format-function-): Do the above changes for the summary
buffer format mark, as well. These two functions need to share more
code.
---
lisp/gnorb-gnus.el | 57 ++++++++++++++++++++++++++++++++++--------------------
1 file changed, 36 insertions(+), 21 deletions(-)
diff --git a/lisp/gnorb-gnus.el b/lisp/gnorb-gnus.el
index a754d5a..6cd37ba 100644
--- a/lisp/gnorb-gnus.el
+++ b/lisp/gnorb-gnus.el
@@ -583,33 +583,48 @@ is relevant to any existing TODO headings. If so, flash a
message
to that effect. This function is added to the
`gnus-article-prepare-hook'. It will only do anything if the
option `gnorb-gnus-hint-relevant-article' is non-nil."
- (when (and gnorb-gnus-hint-relevant-article
- (not (memq (car (gnus-find-method-for-group group))
+ (when (and gnorb-tracking-enabled
+ gnorb-gnus-hint-relevant-article
+ (not (memq (car (gnus-find-method-for-group
+ gnus-newsgroup-name))
'(nnvirtual nnir))))
- (let ((ref-ids (gnus-fetch-original-field "references"))
- (key
- (where-is-internal 'gnorb-gnus-incoming-do-todo
- nil t))
- rel-headings)
- (when ref-ids
- (when (setq rel-headings
- (gnorb-find-visit-candidates ref-ids))
- (message "Possible relevant todo %s, trigger with %s"
- (gnorb-pretty-outline (car rel-headings) t)
- (if key
- (key-description key)
- "M-x gnorb-gnus-incoming-do-todo")))))))
+ (let* ((ref-ids (gnus-fetch-original-field "references"))
+ (msg-id (gnus-fetch-original-field "message-id"))
+ (assoc-heading
+ (gnus-registry-get-id-key msg-id 'gnorb-ids))
+ (key
+ (where-is-internal 'gnorb-gnus-incoming-do-todo
+ nil t))
+ rel-headings)
+ (cond (assoc-heading
+ (message "Message is associated with %s"
+ (gnorb-pretty-outline (car assoc-heading) t)))
+ (ref-ids
+ (when (setq rel-headings
+ (gnorb-find-visit-candidates ref-ids))
+ (message "Possible relevant todo %s, trigger with %s"
+ (gnorb-pretty-outline (car rel-headings) t)
+ (if key
+ (key-description key)
+ "M-x gnorb-gnus-incoming-do-todo"))))))))
(add-hook 'gnus-article-prepare-hook 'gnorb-gnus-hint-relevant-message)
(fset (intern (concat "gnus-user-format-function-"
gnorb-gnus-summary-mark-format-letter))
- (lambda (header)
- (let ((ref-ids (mail-header-references header)))
- (if (and ref-ids
- (gnorb-find-visit-candidates ref-ids))
- gnorb-gnus-summary-mark
- " "))))
+ (lambda (header)
+ (if (and gnorb-tracking-enabled
+ (not (memq (car (gnus-find-method-for-group
+ gnus-newsgroup-name))
+ '(nnvirtual nnir))))
+ (let ((ref-ids (mail-header-references header))
+ (msg-id (mail-header-message-id header)))
+ (if (or (gnus-registry-get-id-key msg-id 'gnorb-ids)
+ (and ref-ids
+ (gnorb-find-visit-candidates ref-ids)))
+ gnorb-gnus-summary-mark
+ " "))
+ " ")))
;;;###autoload
(defun gnorb-gnus-view ()
- [elpa] externals/gnorb 4fc1075 172/449: Rename gnorb-org-window-conf to gnorb-window-conf, (continued)
- [elpa] externals/gnorb 4fc1075 172/449: Rename gnorb-org-window-conf to gnorb-window-conf, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb bb44a8c 174/449: Don't force id creation!, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb b596ee7 157/449: Check for success when following gnus links, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 43fbd55 176/449: New function for restoring window layout, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb fe7d814 179/449: Provide initialization of gnorb email tracking, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb b95f371 186/449: That's not how you use condition-case, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 6653b6c 187/449: Fix gnorb-tracking-initialize, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb f0cfa7b 191/449: Improvements to gnorb-registry-make-entry, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb bdbc96f 195/449: Rename gnorb-gnus-sending-message-info, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb ca85930 197/449: First draft of trigger action reworking, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 9e880eb 200/449: Improve Gnus summary hinting,
Stefan Monnier <=
- [elpa] externals/gnorb 8a0d275 202/449: Docstring for gnorb-registry-org-id-search, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 6293b22 208/449: Squash with the trigger action stuff, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 326fcb0 210/449: Document new tracking system, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 096e39a 209/449: Remove the capture-to-child/sibling actions for now, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 04d2951 211/449: Shadow message forwarding in nngnorb summary buffers, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb b6ab1c5 214/449: Only use the summary reply hook once., Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 46a8e6b 217/449: Assume creation of attachment dirs, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 6f868fb 219/449: Fix logic of finding links to reply to, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 5182998 228/449: Necessary headers in main file, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb ec32255 231/449: Use org-reveal when restoring/triggering, Stefan Monnier, 2020/11/27