From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12.migadu.com with LMTPS id aBAlF2tJhGS6EQEATFOONw (envelope-from ) for ; Sat, 10 Jun 2023 11:59:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id UOlAF2tJhGRzMgAA9RJhRA (envelope-from ) for ; Sat, 10 Jun 2023 11:59:07 +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 1A0D42DCAA for ; Sat, 10 Jun 2023 11:59:03 +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=koI8WkxtlupeTQE7AGDApqmXkeQDKi6eZGJ/Bw0zv6E=; b=WY1bPA3KR92vv27KYxoTBdB1CIIsCl1kNRRSbIMRo/95b9a5GwQZWAAQO70qHajjok7lGw K1KQdXs+irtD8SVX3EtSM6pLRzVWIzR5pH7IsAP3zsbrOBEjRjopUwBkAd7qgnNDVFtg44 YkLqIymPFt8vCxsy90cFW/aNuzQqFXk= To: piem@inbox.kyleam.com Cc: Jelle Licht Subject: [PATCH v3 4/5] piem-inbox-by-header-match: Fallback to matching via :gnu-package Date: Sat, 10 Jun 2023 11:58:57 +0200 Message-Id: <20230610095858.26982-5-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-Seal: i=1; s=key1; d=kyleam.com; t=1686391147; a=rsa-sha256; cv=none; b=bnRTjTVj08zSRrWrQv5A65Nz7GSH0MTaAZMpAzeZxXh9ArC5vYxSCHmAPI3JGHgUUVfQ0t VwuZzBl5cud8+0L+iQjblj9C6yP3surb/o/FuG5sXvZyCtyH3drSOQ0ZTvSBOJHVT4GbJ4 Epd9ND6f/oj2Cg4mbEWOy8YToXIMGDx39D7NifQ0N/FRvvpql1pAd12QNY1wXYA2EFqg4F N7mHdaUn3R015+uOGTkreOgLjiC4W+BiSf5incemBXsB1hZQXQS7Rl9kDTfySkACdQoZO5 GD5Z1oot/l8UeGyYF2TViCCjl9M/mLwNcb1ijVLa86Yww5WX5PpmEpN4J0Om9A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=fsfe.org header.s=2021100501 header.b=WY1bPA3K; 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=1686391147; 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=koI8WkxtlupeTQE7AGDApqmXkeQDKi6eZGJ/Bw0zv6E=; b=WNnDFJGq/1DQ2ASzU1VtI7O9pXSdgjulkuy+wuN18yADzxE5+xVfM97Q4rVkWCi7JxxllK YphPToj7pCcECOtUkP2F5sE/enK9M6P+wJMFJuZNVGOxTGNn/Z/IuNa4ZXdeTg3oniW8EZ M3dBuLrpZDtEJGTDUrmFQrdj5gvHfISy0HnZAje3POD6N2UfvaHyb5x4ijAyQ/HluzKFnQ FJcZfuSsutW8Y8rQJuKzGMNNLZ5q66YzjQEXVqQhv7QhKHYCpeL993Yx7GZ7AthuzBSk+z GlPH/dX8MvrItdFNJObzOVf3LcXRnl63TUIWuAmjJ/ixqdGAnMidWY7OtR1/4w== Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=fsfe.org header.s=2021100501 header.b=WY1bPA3K; 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 X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -7.68 X-Spam-Score: -7.68 X-Migadu-Queue-Id: 1A0D42DCAA X-TUID: 6fP4Dw6wfWrE From: Jelle Licht --- piem.el | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/piem.el b/piem.el index 3a76d43..88309ab 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." -- 2.40.1