From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12.migadu.com with LMTPS id ML3nFmlJhGSz3AAATFOONw (envelope-from ) for ; Sat, 10 Jun 2023 11:59:05 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id +J+nFWlJhGRzzgAAG6o9tA (envelope-from ) for ; Sat, 10 Jun 2023 11:59:05 +0200 Received: from mail1.fsfe.org (mail1.fsfe.org [IPv6:2001:aa8:ffed:f5f3::151]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D1BF93A3AA for ; Sat, 10 Jun 2023 11:59:04 +0200 (CEST) From: jlicht@fsfe.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fsfe.org; s=2021100501; t=1686391142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4Q9I39rssY0y7x1JYGTgbiEJwFCdcRJLTA5shFQakbM=; b=o/4OPAS+ZZGGYn9htWZOFFBkLXjwNtUhPcH54tyCiKjNYol9eGLCqggYCPO23uXL6j2D4U cRoY2Zyke5hRi6nCe083dPNDhDr44eJvDoOvFjlhjkJwgUlzsMMCLBLZSMCtkIbfgzxeR9 8n/nwIv5ZGjG4g5G4qcc86MSWVkK9Cg= To: piem@inbox.kyleam.com Cc: Jelle Licht Subject: [PATCH v3 3/5] piem: Add piem-inbox-by-gnu-package-match Date: Sat, 10 Jun 2023 11:58:56 +0200 Message-Id: <20230610095858.26982-4-jlicht@fsfe.org> In-Reply-To: <20230610095858.26982-1-jlicht@fsfe.org> References: <20230608165926.12586-1-jlicht@fsfe.org> <20230610095858.26982-1-jlicht@fsfe.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Country: DE X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1686391144; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=4Q9I39rssY0y7x1JYGTgbiEJwFCdcRJLTA5shFQakbM=; b=ywhtaQWbTX8mF+wJk6g5VLyntgqIqonk6y3eC0f2NlvTA1RKxXQ4CtfFWguB0akixGNjRT h9UfqV0tlN3KFhhHJGiFFQn+cef4wjKUptTkBSrm3kTNZwNSmRiN+bQ63ktS0P1TLa6itD NYNd8qh56tT0LUV8fWOEzi6qciG9jRX17qhkIUbFvtwnJPpII9et5nFVFvIyHogyFPEmIB 3edyDsa3xYKMBlCfQLDT6MYXRRAcnVEgz+o8l6fchQ/0q9nJl4XxTXUsqrQs6sjoAQHKeH 83SJWkavXGBh3mjU3TnzlaYG/fAzVcsb//Q3pKsiUjOJ1yQu5aC4bEOtfIXbiw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=fsfe.org header.s=2021100501 header.b="o/4OPAS+"; dmarc=pass (policy=none) header.from=fsfe.org; spf=pass (aspmx1.migadu.com: domain of jlicht@fsfe.org designates 2001:aa8:ffed:f5f3::151 as permitted sender) smtp.mailfrom=jlicht@fsfe.org ARC-Seal: i=1; s=key1; d=kyleam.com; t=1686391144; a=rsa-sha256; cv=none; b=r8wPW7sOxe7jgs4bchGqsPAkBDysagTj/WxAgIclJnJc9lMZjbJSWshC71Li4+AbOdkbKS WXv4+l2/Rt2b2qRCt2UpI4UoJv2+t+Isi2GvVlOPs2pkShZ6DATYPDPMeUXnDjtgWfX/XD M9vEppxZnQApX/ZXZY/SvLuLGYN2aV9cGTpyAMz9WnNiGfMJaTq2NQE/n1ypkzNFUUIkjQ TSk6XR6s9mer45op9q6EJR74kTY3tEys65BTIF3rrzC2/CyRgzVLufua36Nb8iBTWqMCRm 5UFxAzURUxJ8c/JYcOOExe5C9DHH7t5Nuo2a+CJhwG48/f6vBD33vhQp4rlgNA== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -7.70 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=fsfe.org header.s=2021100501 header.b="o/4OPAS+"; dmarc=pass (policy=none) header.from=fsfe.org; spf=pass (aspmx1.migadu.com: domain of jlicht@fsfe.org designates 2001:aa8:ffed:f5f3::151 as permitted sender) smtp.mailfrom=jlicht@fsfe.org X-Migadu-Queue-Id: D1BF93A3AA X-Spam-Score: -7.70 X-TUID: IsSZVpnU9zLz From: Jelle Licht --- piem.el | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/piem.el b/piem.el index cf78d9b..3a76d43 100644 --- a/piem.el +++ b/piem.el @@ -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-match-p (regexp-quote p-package) + 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 -- 2.40.1