diff options
author | Jelle Licht <jlicht@fsfe.org> | 2023-06-10 11:58:56 +0200 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2023-06-10 19:09:31 -0400 |
commit | 0efb95abc51f4730f70670abbce462c5ac86e019 (patch) | |
tree | 31d8f9a04c8667430550b2ff00860f71a8c404c1 | |
parent | 4b9490abb372b1bd66444f780a2fe352c5a89a2f (diff) | |
download | piem-0efb95abc51f4730f70670abbce462c5ac86e019.tar.gz |
piem: Add piem-inbox-by-gnu-package-match
Message-ID: <20230610095858.26982-4-jlicht@fsfe.org>
-rw-r--r-- | piem.el | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -492,6 +492,22 @@ non-nil, make the match specific for that message." (mail-decode-encoded-word-string val))) headers)))) +(defun piem-inbox-by-gnu-package-match (gnu-package) + "Return inbox based on matching :gnu-package properties. +GNU-PACKAGE should be a string. This function is intended to be +used by libraries implementing a function for +`piem-get-inbox-function'." + (when gnu-package + (catch 'hit + (dolist (inbox (piem-merged-inboxes)) + (let* ((info (cdr inbox)) + (p-package (plist-get info :gnu-package))) + (when (and gnu-package + p-package + (string-equal (downcase p-package) + (downcase gnu-package))) + (throw 'hit (car inbox)))))))) + (defun piem-inbox-by-header-match () "Return inbox based on matching message headers. This should be called from a buffer containing a message and is |