[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnorb 36303d9 213/449: Do a better job of dealing with
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnorb 36303d9 213/449: Do a better job of dealing with reference headers |
Date: |
Fri, 27 Nov 2020 23:15:41 -0500 (EST) |
branch: externals/gnorb
commit 36303d92cd20c1ae32e3ad51f01f2759c9c65238
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>
Do a better job of dealing with reference headers
In all cases, examine both References and In-Reply-To, and also use
existing Gnus utilities for handling the values.
* lisp/gnorb-gnus.el (gnorb-gnus-check-outgoing-headers,
gnorb-gnus-outgoing-do-todo): Check In-Reply-To header in addition to
References. If possible, split the value with gnus-extract-references.
* lisp/gnorb-registry.el (gnorb-find-visit-candidates): Check here for
string values, and use gnus-extract-references if necessary.
---
lisp/gnorb-gnus.el | 10 ++++++++--
lisp/gnorb-registry.el | 6 +++---
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/lisp/gnorb-gnus.el b/lisp/gnorb-gnus.el
index a48eacf..812ea43 100644
--- a/lisp/gnorb-gnus.el
+++ b/lisp/gnorb-gnus.el
@@ -262,6 +262,7 @@ information about the outgoing message into
(let* ((org-ids (mail-fetch-field gnorb-mail-header nil nil t))
(msg-id (mail-fetch-field "Message-ID"))
(refs (mail-fetch-field "References"))
+ (in-reply-to (mail-fetch-field "In-Reply-To"))
(to (if (message-news-p)
(mail-fetch-field "Newsgroups")
(mail-fetch-field "To")))
@@ -276,8 +277,10 @@ information about the outgoing message into
(group (ignore-errors (car (split-string link "#")))))
;; If we can't make a real link, then save some information so
;; we can fake it.
+ (when in-reply-to
+ (setq refs (concat refs " " in-reply-to)))
(when refs
- (setq refs (split-string refs "[ ,]+")))
+ (setq refs (gnus-extract-references refs)))
(setq gnorb-gnus-message-info
`(:subject ,subject :msg-id ,msg-id
:to ,to :from ,from
@@ -322,7 +325,7 @@ work."
(interactive "P")
(let ((org-refile-targets gnorb-gnus-trigger-refile-targets)
header-ids ref-ids rel-headings gnorb-window-conf
- reply-id reply-group)
+ reply-id reply-group in-reply-to)
(when arg
(setq rel-headings
(org-refile-get-location "Trigger action on" nil t))
@@ -369,6 +372,9 @@ work."
;; what org id headers are present, though, so we don't add
;; duplicates.
(setq ref-ids (unless arg (mail-fetch-field "References" t)))
+ (setq in-reply-to (unless arg (mail-fetch-field "In-Reply-to" t)))
+ (when in-reply-to
+ (setq ref-ids (concat ref-ids " " in-reply-to)))
(setq reply-group (when (mail-fetch-field "X-Draft-From" t)
(car-safe (read (mail-fetch-field "X-Draft-From"
t)))))
;; when it's a reply, store a link to the reply just in case.
diff --git a/lisp/gnorb-registry.el b/lisp/gnorb-registry.el
index 0e8f15b..21e5410 100644
--- a/lisp/gnorb-registry.el
+++ b/lisp/gnorb-registry.el
@@ -112,11 +112,11 @@ to the message's registry entry, under the 'gnorb-ids
key."
(defun gnorb-find-visit-candidates (ids)
"For all message-ids in IDS (which should be a list of
Message-ID strings, with angle brackets, or a single string of
-Message-IDs separated by spaces or commas), produce a list of Org
-ids for headings that are relevant to that message."
+Message-IDs), produce a list of Org ids for headings that are
+relevant to that message."
(let (ret-val sub-val)
(when (stringp ids)
- (setq ids (split-string ids "[ ,]+")))
+ (setq ids (gnus-extract-references ids)))
(when gnorb-tracking-enabled
(progn
(dolist (id ids)
- [elpa] externals/gnorb eaa4bf4 181/449: Begin shifting candidate finding to the registry, (continued)
- [elpa] externals/gnorb eaa4bf4 181/449: Begin shifting candidate finding to the registry, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 7f4dbed 180/449: Don't check for relevant headings if not tracking, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 093c4ed 185/449: Spurious 'g', Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 8121bf5 188/449: Stop creating hash table entries and GNORB_MSG_IDS, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 7b70966 190/449: Look up tracked messages via the registry, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 5ba511e 198/449: Dispense with the "insert a link" message, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 05e6a02 204/449: Docstring for gnorb-msg-id-to-link, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 4f302fa 205/449: New gnorb-collect-ids utility function, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 01e7b1e 206/449: New minor mode for nnir summary buffers, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 69ddfd3 212/449: Delete duplicate org-ids for outgoing messages, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 36303d9 213/449: Do a better job of dealing with reference headers,
Stefan Monnier <=
- [elpa] externals/gnorb 01645a4 215/449: Allowing fetching attachments from specific IDs, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 305a704 216/449: Don't append the message-exit-action, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb d0d196f 222/449: Check prefix arg correctly, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 9a76fad 226/449: Use org-element-interpret-data to get paragraph text, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 09346e0 141/449: BBDB message link list needs closing newline, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 69980d3 143/449: Improvements to nnir-run-gnorb, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb ebce811 144/449: Also check for nnir when storing BBDB message links, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 5101731 150/449: Improvements to TODOs made from outgoing messages, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb b841d17 146/449: Wishlist changes, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 8958546 155/449: Backquote escape fail, Stefan Monnier, 2020/11/27