From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12.migadu.com with LMTPS id OI+7E7Afg2QsUAEATFOONw (envelope-from ) for ; Fri, 09 Jun 2023 14:48:48 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id iJaHE7Afg2RL5QAAauVa8A (envelope-from ) for ; Fri, 09 Jun 2023 14:48:48 +0200 Received: from mail1.fsfe.org (mail1.fsfe.org [217.69.89.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 E1A4B39183 for ; Fri, 9 Jun 2023 14:48:43 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=fsfe.org header.s=2021100501 header.b=VQ5m2tAQ; dmarc=pass (policy=none) header.from=fsfe.org; spf=pass (aspmx1.migadu.com: domain of jlicht@fsfe.org designates 217.69.89.151 as permitted sender) smtp.mailfrom=jlicht@fsfe.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1686314927; 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=dT27jg/PxeMSH/ivG4x5LeuNPgoF4u2u5CRQfVZH9Ig=; b=blVFx6isEud2ZGFU24OVFjboP3spRawYe2UYDOkY+zf5HCyHTTAOP3SUTGbTu4iQOu1R4D JY/VTr8gpMHZxllvJtuaBPozZaWSny3WgK16qouwzQcvQlmrs1eVYiFv+S4aPr8oWIUWGV IaR3ggNU+gIIvT44tOsv5utVTKmyXmxstVo82vW5zOF2T7rssAFhmorrXjX9sqeH0H/pPt bSpOLGaTcrJAiWXcYG0xGqcUHWl4MWhBPeLn/qEPS6oJPr8nZiHMMpCPObM/eGOjFX/WSc t/ttBSDoL5NUX4WucFqyLBxk4nUDyi+0ZkzpWDbB+fvoc9ClAGi3Kt/oORJF7A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=fsfe.org header.s=2021100501 header.b=VQ5m2tAQ; dmarc=pass (policy=none) header.from=fsfe.org; spf=pass (aspmx1.migadu.com: domain of jlicht@fsfe.org designates 217.69.89.151 as permitted sender) smtp.mailfrom=jlicht@fsfe.org ARC-Seal: i=1; s=key1; d=kyleam.com; t=1686314927; a=rsa-sha256; cv=none; b=RFhN8Ljp7SCQvNvdtj+FEVaYgX6Wup+UscHXHm8Ta9swsXWRdP3Kiz8scjCAiX2j51GXcQ W+LAO9Z0FygxFcncGLSnfFqepQ8fywWR3QJWhwLLblL4caTLF2Qg7XTlV+B9vJ3s0YmxtF EusNa0gNdHmUimY4MMLAlms2nOljlY9r0Rfk11/ynk2J410Kkpy34qfcAJxCBdBxkPN6mi KDMuYiru4grmLx+cPUtBLGWDeBhfxMVUg9saJvilo5CxjG8RbowsRjk+WA7Txbi2PtVm9l eeqmurQEtFHL9xY2/md5IlkjJ7lzYNAP3CrICqGRnDjt1Hfj3e4GxmjyQixGOQ== From: jlicht@fsfe.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fsfe.org; s=2021100501; t=1686314913; 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=dT27jg/PxeMSH/ivG4x5LeuNPgoF4u2u5CRQfVZH9Ig=; b=VQ5m2tAQHVo32hA0wz4qafmPqe0b6LnYc5exmb7gj8OG1fF1+HSZf6TwbL4cCh/qqX48FE 0f3iFQaNNdFHfsO6JZDM683kJMvcJNeUQTvPCNerEHuY7ZmO1HzfslSGHOYY+gRnr1pGIR /KyRQk8JH1Jw/+QmSdBdcR54k88mAZY= To: piem@inbox.kyleam.com Cc: Jelle Licht Subject: [PATCH v2 3/5] piem: Add piem-inbox-by-gnu-package-match. Date: Fri, 9 Jun 2023 14:48:27 +0200 Message-Id: <20230609124829.29629-4-jlicht@fsfe.org> In-Reply-To: <20230609124829.29629-1-jlicht@fsfe.org> References: <20230608165926.12586-1-jlicht@fsfe.org> <20230609124829.29629-1-jlicht@fsfe.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Country: UNKNOWN X-Migadu-Flow: FLOW_IN X-Spam-Score: -4.61 X-Migadu-Queue-Id: E1A4B39183 X-Migadu-Scanner: in3.migadu.com X-Migadu-Spam-Score: -4.61 X-TUID: /4nKRdSP00dT From: Jelle Licht --- piem.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/piem.el b/piem.el index 914dd23..3fffb0e 100644 --- a/piem.el +++ b/piem.el @@ -490,6 +490,21 @@ 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 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