aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelle Licht <jlicht@fsfe.org>2023-06-10 11:58:57 +0200
committerKyle Meyer <kyle@kyleam.com>2023-06-10 19:09:31 -0400
commitb4470a4921740a13114d6d4b7fbd1b04c5ecaeee (patch)
treef2b1adb000d95460792c09164ebd177dbd9dcdc8
parent0efb95abc51f4730f70670abbce462c5ac86e019 (diff)
downloadpiem-b4470a4921740a13114d6d4b7fbd1b04c5ecaeee.tar.gz
piem-inbox-by-header-match: Fallback to matching via :gnu-package
-rw-r--r--piem.el35
1 files changed, 19 insertions, 16 deletions
diff --git a/piem.el b/piem.el
index ca10b77..d202e15 100644
--- a/piem.el
+++ b/piem.el
@@ -513,22 +513,25 @@ used by libraries implementing a function for
This should be called from a buffer containing a message and is
intended to be used by libraries implementing a function for
`piem-get-inbox-functions'."
- (pcase-let ((`(,listid ,to ,cc)
- (piem--message-fetch-decoded-fields '("list-id" "to" "cc"))))
- (catch 'hit
- (dolist (inbox (piem-merged-inboxes))
- (let* ((info (cdr inbox))
- (p-listid (plist-get info :listid)))
- (when (and listid
- p-listid
- (string-match-p (concat "<" (regexp-quote p-listid) ">")
- listid))
- (throw 'hit (car inbox)))
- (when-let ((addr (plist-get info :address))
- (to (mapconcat #'identity (list to cc)
- " ")))
- (when (string-match-p (regexp-quote addr) to)
- (throw 'hit (car inbox)))))))))
+ (pcase-let ((`(,listid ,to ,cc ,gnu-package)
+ (piem--message-fetch-decoded-fields
+ '("list-id" "to" "cc" "x-gnu-pr-package"))))
+ (or (catch 'hit
+ (dolist (inbox (piem-merged-inboxes))
+ (let* ((info (cdr inbox))
+ (p-listid (plist-get info :listid)))
+ (when (and listid
+ p-listid
+ (string-match-p
+ (concat "<" (regexp-quote p-listid) ">")
+ listid))
+ (throw 'hit (car inbox)))
+ (when-let ((addr (plist-get info :address))
+ (to (mapconcat #'identity (list to cc)
+ " ")))
+ (when (string-match-p (regexp-quote addr) to)
+ (throw 'hit (car inbox)))))))
+ (piem-inbox-by-gnu-package-match gnu-package))))
(defun piem-inbox ()
"Return the current buffer's inbox."