From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 wLkBIPQIgmRvUAAATFOONw (envelope-from ) for ; Thu, 08 Jun 2023 18:59:32 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id WNudH/QIgmQ2YQEAauVa8A (envelope-from ) for ; Thu, 08 Jun 2023 18:59:32 +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 21B543F65E for ; Thu, 8 Jun 2023 18:59:28 +0200 (CEST) From: jlicht@fsfe.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fsfe.org; s=2021100501; t=1686243567; 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; bh=yBFm25R/POkzXf1MHfSjbamzCZY9v2bPtCfL7P/FoQ8=; b=aKzdX4TEFylEc5udYvEwkXjR86jNouXU7CslR1UbqQgKOftvHOmHWBlqqoYYXcXSN5UDfF 6BWcD2jTpIxscdBx0wb2zt4Wl5Kh6sd9KRyn2+dgrsRgZlMh8q/ENlDBQQx37hEozJOgEW TvPxDmCk6F2A5Q/rw46rRFd8vuJsmfI= To: piem@inbox.kyleam.com Cc: Jelle Licht Subject: [PATCH 1/2] piem: Add :gnu-package keyword to piem-inboxes Date: Thu, 8 Jun 2023 18:59:25 +0200 Message-Id: <20230608165926.12586-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=1686243572; a=rsa-sha256; cv=none; b=if4lVRkMtJs5ATcc6F1BZbFWnOz+U9TbKcQVnNJHSRp65H/pdLIAuIE2aWHp9eJc8Bk4h9 9Rb4NzU9cYqo8W44RS6+irL3wROWacZlWXLe8lK613i1/1ui+K1rPorzHhVobVIMMYSWsi JYZkBNwq7heOGF8AytZ0y7ni252COB9uSUOUrSovEzcKbZ7tLTX4emzmZ5Kq+qW4ojmaJC DlCRdq5JLeQ/E7iJzUXBSJIFk2hKu9JPWF901WgnufLQSXsRe8AesHxNV03gpk/W1vUSp6 A/rjzWX74D6FpaU2dVLuu9uoodMjaPMjCq/+dLCd6QydDJ2GNcGfSDGBLJ1Wpg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=fsfe.org header.s=2021100501 header.b=aKzdX4TE; 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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1686243572; 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:dkim-signature; bh=yBFm25R/POkzXf1MHfSjbamzCZY9v2bPtCfL7P/FoQ8=; b=l+L1OYWO2v8aAIkGXjNwGxZeGOb2jTKX5l8LAj78SySovTe7NEY/1rF7C4X6nlOXR5Jonl wQmCRXsjuY/d5VMsT8BjamuwEAsztz7ysG13Az6Gj8UBcPJ9iPAHM7AsEGOwQKalRXr7gJ xvhixXFkDQq0EYE6cq3iWBzvhXOuo95Gdi/dWf1BYx2HH+YOhwS5c+r3KFFqs/qFHXvAok ZrQr4HxUD6OjojfsQVCKNKNcSfBS1su9TqhazjDsMtoR9rOcZvODvzTYUr6ZJV8gpJzWvV NPOJqi8Mw0qQ5SDufzDNJEDbkCt9GJmhGLhoyamjeAIL1leOOTB+uVz9xoyJ5Q== Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=fsfe.org header.s=2021100501 header.b=aKzdX4TE; 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-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -7.69 X-Spam-Score: -7.69 X-Migadu-Queue-Id: 21B543F65E X-TUID: cg6VOIskseIB From: Jelle Licht With the `:gnu-package` keyword, users can configure a regex to match against the X-GNU-PR-PACKAGE email header for the GNU Bug Tracker. --- Documentation/piem.texi | 6 ++++++ piem.el | 18 +++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Documentation/piem.texi b/Documentation/piem.texi index 26962a4..99185d3 100644 --- a/Documentation/piem.texi +++ b/Documentation/piem.texi @@ -168,6 +168,12 @@ repository (e.g., if the inbox receives patches for multiple projects, or if you use a few dedicated Git worktrees for different types of patches), set @code{:coderepo} to a list of locations. +@cindex issue tracking +@cindex Debbugs, issue tracking system +When using the Debbugs instance at @uref{https://bugs.gnu.org} to +retrieve messages, an inbox can mapped to each message by setting +@code{:gnu-package} for an inbox. + @findex piem-merged-inboxes @vindex piem-get-inboxes-from-config If you mirror some inboxes locally (e.g., for fast local access or for diff --git a/piem.el b/piem.el index 568e91b..b910893 100644 --- a/piem.el +++ b/piem.el @@ -83,6 +83,8 @@ list that supports the following properties: A URL hosting HTTPS archives. :maildir A Maildir directory to inject messages into. + :gnu-package + A GNU Bug Tracker label to match with for the inbox. Here's an example for the public-inbox project itself: @@ -393,7 +395,7 @@ files." (rx string-start "publicinbox." (group (one-or-more not-newline)) "." (group - (or "address" "coderepo" "listid" "maildir" "url")) + (or "address" "coderepo" "listid" "maildir" "url" "gnu-package")) string-end) key) (let* ((inbox-name (match-string 1 key)) @@ -493,12 +495,14 @@ non-nil, make the match specific for that message." 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")))) + (pcase-let ((`(,listid ,to ,cc ,x-gnu-pr-package) + (piem--message-fetch-decoded-fields + '("list-id" "to" "cc" "x-gnu-pr-package")))) (catch 'hit (dolist (inbox (piem-merged-inboxes)) (let* ((info (cdr inbox)) - (p-listid (plist-get info :listid))) + (p-listid (plist-get info :listid)) + (p-package (plist-get info :gnu-package))) (when (and listid p-listid (string-match-p (concat "<" (regexp-quote p-listid) ">") @@ -508,7 +512,11 @@ intended to be used by libraries implementing a function for (to (mapconcat #'identity (list to cc) " "))) (when (string-match-p (regexp-quote addr) to) - (throw 'hit (car inbox))))))))) + (throw 'hit (car inbox)))) + (when (and x-gnu-pr-package + p-package + (string-match-p (regexp-quote p-package) x-gnu-pr-package)) + (throw 'hit (car inbox)))))))) (defun piem-inbox () "Return the current buffer's inbox." -- 2.40.1