From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:1004:224b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id yC6yGr3oTmSaMQEAkFu2QA (envelope-from ); Mon, 01 May 2023 00:16:29 +0200 Received: from mta0.migadu.com ([2001:41d0:1004:224b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id iFvVGb3oTmTtBAAAG6o9tA (envelope-from ); Mon, 01 May 2023 00:16:29 +0200 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1682892989; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YeRnlqJ8PC2MssCj/g2ToPHPnxNVS6wcQwVBvOd+97E=; b=HYHkpKfTHeqxhoUHEDUFixRicVcRoaxGvCOEavXE1ScYv83j5FBc5oOx2jM7EnuLXyWOjZ uAo2juWVHE4b58XNNOq8FSXez7d4xqm2WFGmEJJrNAKC8oUWEw67nxjRa6JTZBdWBWe79V s1RMDQSL/YSRJDs1cJRL6tOX8TevLqjw9BOM+t/xVZxD1A8PWccPGEJKjOsrlLrmaDBNlW +uzA1Z5BFm7gsEfYVUnIN02GnptJgc+nKiDdPPMuDVNWiVUZL6dSraEH3HHdQvK+XlZlhS hLNEQtJ42/TpPAo6b4yOvWNTraGHSlw4R/M5nLTkzRN4IKjcs8VC52T0OSYCIA== From: Kyle Meyer To: piem@inbox.kyleam.com Subject: [PATCH 2/4] piem-am-ready-mbox: Adjust header regex for format-patch change Date: Sun, 30 Apr 2023 18:15:50 -0400 Message-Id: <20230430221552.251335-3-kyle@kyleam.com> In-Reply-To: <20230430221552.251335-1-kyle@kyleam.com> References: <20230430221552.251335-1-kyle@kyleam.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-TUID: WF85/xw3fi8c As of git.git's ba4324c4e1 (e-mail workflow: Message-ID is spelled with ID in both capital letters, 2023-04-03), git-format-patch inserts a Message-ID header instead of Message-Id. Teach piem--insert-message-id-header to look for either variants when it checks for an existing header. Another option would be to ignore the header case entirely. However, piem--insert-message-id-header is intended to work only for format-patch output, so stick with the stricter header matching. --- piem.el | 5 ++++- tests/piem-tests.el | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/piem.el b/piem.el index 63c358a2..9dc7f3e3 100644 --- a/piem.el +++ b/piem.el @@ -601,8 +601,11 @@ (defun piem--insert-message-id-header (mid) (rx line-start (zero-or-one space) line-end)))) (cond ((looking-at-p + ;; git-format-patch switched to "Message-ID" spelling + ;; in v2.41. (rx line-start - "Message-Id: <" (one-or-more not-newline) ">" + "Message-" (or "Id" "ID") + ": <" (one-or-more not-newline) ">" line-end)) (throw 'has-message-id nil)) ((looking-at-p diff --git a/tests/piem-tests.el b/tests/piem-tests.el index 79d8591e..6f39a53e 100644 --- a/tests/piem-tests.el +++ b/tests/piem-tests.el @@ -179,6 +179,24 @@ (ert-deftest piem--insert-message-id-header () (should-not (with-temp-buffer (piem--insert-message-id-header "msg@id"))) + (should-not + (string-match-p + "Message-Id: " + (with-temp-buffer + (insert "\ +From 0d732713af1f3fb48b37430e2cd0a3033cea14f3 Mon Sep 17 00:00:00 2001 +From: Foo Bar +Message-ID: +Date: Fri, 22 Jan 2021 22:35:58 -0500 +Subject: [PATCH] a + +--- + a | 1 + + 1 file changed, 1 insertion(+) + create mode 100644 a") + (goto-char (point-min)) + (piem--insert-message-id-header "msg@id") + (buffer-string)))) (should (string-match-p (concat -- 2.39.2