[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnorb 6f868fb 219/449: Fix logic of finding links to re
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnorb 6f868fb 219/449: Fix logic of finding links to reply to |
Date: |
Fri, 27 Nov 2020 23:15:43 -0500 (EST) |
branch: externals/gnorb
commit 6f868fb3cbede25ca3065e59156c115b93dda0dc
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>
Fix logic of finding links to reply to
* lisp/gnorb-org.el (gnorb-org-extract-mail-tracking): Behavior was not
matched to the docstring, this should do it.
---
lisp/gnorb-org.el | 59 ++++++++++++++++++++++++++++++-------------------------
1 file changed, 32 insertions(+), 27 deletions(-)
diff --git a/lisp/gnorb-org.el b/lisp/gnorb-org.el
index 650b4f2..9b1487e 100644
--- a/lisp/gnorb-org.el
+++ b/lisp/gnorb-org.el
@@ -234,33 +234,38 @@ See the docstring of `gnorb-org-handle-mail' for details."
(gnorb-org-extract-mail-tracking assoc-msg-ids arg region))))
(defun gnorb-org-extract-mail-tracking (assoc-msg-ids &optional arg region)
- ;; Get the most recent message that wasn't sent by our user.
- (let* ((latest-msg-id
- (car
- (sort
- (remove-if
- (lambda (m)
- (let ((from (car (gnus-registry-get-id-key m 'sender))))
- (or (null from)
- (string-match-p
- user-mail-address from)
- (string-match-p
- message-alternative-emails from))))
- assoc-msg-ids)
- (lambda (r l)
- (time-less-p
- (car (gnus-registry-get-id-key l 'creation-time))
- (car (gnus-registry-get-id-key r 'creation-time)))))))
- ;; Turn it into the kind of link that `gnorb-org-handle-mail'
- ;; is expecting. If this routine changes significantly, we
- ;; should change the format of the return value.
- (latest-link (gnorb-msg-id-to-link latest-msg-id))
- ;; With a prefix arg, or with no tracked messages, also
- ;; collect mailto: and bbdb: links from the subtree.
- (all-links (when (or arg (not latest-link))
- (gnorb-org-extract-links nil region))))
- (plist-put all-links :gnus
- (when latest-link (list latest-link)))))
+
+ (let* ((all-links (gnorb-org-extract-links nil region))
+ ;; The latest (by the creation-time registry key) of all the
+ ;; tracked messages that were not sent by our user.
+ (latest-msg-id
+ (when assoc-msg-ids
+ (car
+ (sort
+ (remove-if
+ (lambda (m)
+ (let ((from (car (gnus-registry-get-id-key m 'sender))))
+ (or (null from)
+ (string-match-p
+ user-mail-address from)
+ (string-match-p
+ message-alternative-emails from))))
+ assoc-msg-ids)
+ (lambda (r l)
+ (time-less-p
+ (car (gnus-registry-get-id-key l 'creation-time))
+ (car (gnus-registry-get-id-key r 'creation-time)))))))))
+ (cond
+ ;; If there are no tracked messages, or the user has specifically
+ ;; requested we ignore them with the prefix arg, just return the
+ ;; found links in the subtree.
+ ((or arg
+ (null latest-msg-id))
+ all-links)
+ ;; Otherwise ignore the other links in the subtree, and return
+ ;; the latest message.
+ (latest-msg-id
+ `(:gnus ,(list (gnorb-msg-id-to-link latest-msg-id)))))))
(defun gnorb-org-setup-message
(&optional messages mails from cc bcc attachments text ids)
- [elpa] externals/gnorb bdbc96f 195/449: Rename gnorb-gnus-sending-message-info, (continued)
- [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, 2020/11/27
- [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 <=
- [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
- [elpa] externals/gnorb 4da19b0 232/449: Get rid of gnorb-org-mail-todos, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 01f0a31 235/449: Move all *.el files out of lisp/ to top directory, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb eab79ec 241/449: Allow attachment transfers in nngnorb summary buffers, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 20de4ee 104/449: Caching of msg-id to org-id correlations, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb edab89d 110/449: Be more careful about cleaning up attachments, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 6375f83 112/449: And append doesn't modify destructively..., Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb f7b93f2 115/449: Whitespace/indentation cleanup, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb e86d24a 119/449: Robustification of nngnorb nnir message viewing, Stefan Monnier, 2020/11/27