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 ms5.migadu.com with LMTPS id GBnMNA6y62I/NQAAbAwnHQ (envelope-from ) for ; Thu, 04 Aug 2022 13:48:30 +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 iJvVMw6y62JMXQEAG6o9tA (envelope-from ) for ; Thu, 04 Aug 2022 13:48:30 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (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 60ADD428D7 for ; Thu, 4 Aug 2022 13:48:30 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id DB5C55F3E5; Thu, 4 Aug 2022 11:48:20 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id 7E11F5F37F for ; Thu, 4 Aug 2022 11:48:17 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id D67A55FBC4; Thu, 4 Aug 2022 07:48:16 -0400 (EDT) Received: (nullmailer pid 490707 invoked by uid 1000); Thu, 04 Aug 2022 11:48:13 -0000 From: David Bremner To: David Bremner , notmuch@notmuchmail.org Subject: [PATCH 3/3] emacs: add duplicate support to notmuch-show-view-raw-message Date: Thu, 4 Aug 2022 08:48:08 -0300 Message-Id: <20220804114808.490686-3-david@tethera.net> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20220804114808.490686-1-david@tethera.net> References: <20220804110833.322155-2-david@tethera.net> <20220804114808.490686-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: HZZHYGPHXLZBZVEEC6IZPX3XRPIHUJ2A X-Message-ID-Hash: HZZHYGPHXLZBZVEEC6IZPX3XRPIHUJ2A X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1659613710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=kdtPl8kFOr4/fokxUV0iAXoS4GkdBgqgMmo2DjVwb0I=; b=cawBZi5Q2QuJrQaYI2O/zFnXPaTPY+HIqFgFU1YswmUM+tnkE1xxZuAeHKcoFdpPwGfvJe sc5CF+PkWFMOWOXtpwqLRlomPRHgWx+AEoKt4VJk+M5zwpaGDRiZ5ZEtH3xowXtCpfNeYH 7q519+1bJsqVybv1DSjyzx8Ph3jw67OCP5aoJRmJntg8Ze/yStsPW2zrdonjvoRMslwLeu Gnd5zZXd+Lg9UX8Vnpl8eZimpNyj6CV50V/OACjIewqM2xPylo7ed2Acux13sV4sUCOeR/ Q0i4A2SSeim0mj7RPv3HGlTzA7hIaIEBZjpRUaPZtf99RK/4+ELcpLHo1lTaPQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1659613710; a=rsa-sha256; cv=none; b=HE9GOkzAaiC23xWyW7RqClxmoZVrdgY1kLriR+k1C3gHGQFcdxBYSM/VJgH69KyBNTxyWj rjQsnUhsPIPntxiibBPUAJr3beGXugp2q+T7qkKkEagXpLut67zc6idbYVvNOTay9MCdwv 8yWAb23IL9wMx/YmLf81MPzINs6XfV/udQ0gC87xHMuQmt4wUwj2zqTRfDq4dQ7KGm69t4 M/o6NliIPwHihzkNp+zJjteM8QbKRhSIZzg3plKXUgyDUMdQzEAtwrEc0Hw3GsG5fHjbmZ MPHna/UJXPwLO62PUbSruUu0jTGRYgBNMSSuo3C3iOXC9lntZ/mZhKBuEo+s/w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.31 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 60ADD428D7 X-Spam-Score: -1.31 X-Migadu-Scanner: scn1.migadu.com X-TUID: wlKNf6ulJl0w This fixes one of the bugs reported by Gregor in [1] [1]: id:87edxw8jp4.fsf@no.workgroup --- emacs/notmuch-show.el | 8 ++++++-- test/T450-emacs-show.sh | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index e9a9ac2c..a6650678 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -2143,12 +2143,16 @@ to show, nil otherwise." "View the original source of the current message." (interactive) (let* ((id (notmuch-show-get-message-id)) - (buf (get-buffer-create (concat "*notmuch-raw-" id "*"))) + (duplicate (notmuch-show-get-duplicate)) + (args (if (> duplicate 1) + (list (format "--duplicate=%d" duplicate) id) + (list id))) + (buf (get-buffer-create (format "*notmuch-raw-%s-%d*" id duplicate))) (inhibit-read-only t)) (pop-to-buffer-same-window buf) (erase-buffer) (let ((coding-system-for-read 'no-conversion)) - (notmuch--call-process notmuch-command nil t nil "show" "--format=raw" id)) + (apply #'notmuch--call-process notmuch-command nil t nil "show" "--format=raw" args)) (goto-char (point-min)) (set-buffer-modified-p nil) (setq buffer-read-only t) diff --git a/test/T450-emacs-show.sh b/test/T450-emacs-show.sh index 83e902f1..c4202e0a 100755 --- a/test/T450-emacs-show.sh +++ b/test/T450-emacs-show.sh @@ -383,7 +383,6 @@ test_expect_equal_file_nonempty $EXPECTED/notmuch-show-duplicate-4 OUTPUT FILE4=$(notmuch search --output=files --duplicate=4 "id:${ID3}") test_begin_subtest "duplicate=4, raw" -test_subtest_known_broken test_emacs "(notmuch-show \"id:${ID3}\") (notmuch-show-choose-duplicate 4) (notmuch-show-view-raw-message) -- 2.35.2