From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id MBfeKsSo62IBrwAAbAwnHQ (envelope-from ) for ; Thu, 04 Aug 2022 13:08:52 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id aHLwKsSo62IoawEA9RJhRA (envelope-from ) for ; Thu, 04 Aug 2022 13:08:52 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (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 571102EC37 for ; Thu, 4 Aug 2022 13:08:52 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id B6BC45F394; Thu, 4 Aug 2022 11:08:46 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 662CD5F37E for ; Thu, 4 Aug 2022 11:08:43 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id CEE755FBC2; Thu, 4 Aug 2022 07:08:42 -0400 (EDT) Received: (nullmailer pid 322176 invoked by uid 1000); Thu, 04 Aug 2022 11:08:41 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH 2/2] emacs: update notmuch-show-get-filename to handle duplicates Date: Thu, 4 Aug 2022 08:08:33 -0300 Message-Id: <20220804110833.322155-2-david@tethera.net> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20220804110833.322155-1-david@tethera.net> References: <20220804110833.322155-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: C4WWLEQGIQW7UDICA2ZHVH4ECSO2CPQF X-Message-ID-Hash: C4WWLEQGIQW7UDICA2ZHVH4ECSO2CPQF 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=1659611332; 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=QOvnbz75+Du6Hs7JRshhbWwBBOupDyKjUlaHqVkPZ5U=; b=WLhsn06E90ub9ad4HiTkpwTe1g114wnW39rTRhl1udlZU6o33LDMCi+H/J6wqCbc6k3kqP sMtVKaT2tXw3XXuuptAF1X/sDj19xcw5BuvNheCaWMxLQ+PNMoOGAZjjp0a7TbXBzJCTBj 0GCOhMy0ZQAKSvqQRXz94GnbAIDPZ9nqZnHzj4JPMRtdu/XWx97fFrp9yE9EqPSy6yair2 EASS74Yxeh41oLfz40s1Ga6kvEHQN+1m4+xRbLMyDEGpx+sUIgu8vHKBehsnmzWF6P9iSE k3I733AtSA0TzjZMvnlaGIDKN1FVKqJhoXX81MHf8B21zEeHweB3qbW4VzezSg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1659611332; a=rsa-sha256; cv=none; b=foVCIipGngv7SGSDotnC+dsQ0iUWcb0QuWBqMNlR0U+P5cl/rWROfh/hB/Xv4NbGEn314J lycOa2csKLvl4JRPh+ciqRW2Xn8wJihyTmfwFLotm5TbySAGVbx+AwZi1jBQ+6z83JJYG9 LxF2KeYaMYfoW3AwWOek3YrfoK95s9obPNwAsxY/0J4iwb5IiqqnyPxAGkiDprjJIWkSzQ QJkyhq7NN7VmUju6g1405RWiGZlxwMK9ksYnmMtN5gX8o0DXn3g60/ztjE1ksdS3ICEVai UifjS3o9tjEU1VphB8uGcjJEUjTWVrvQXAqJW44IfxEFxttNpGGkHhuEiRG3yw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.64 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 571102EC37 X-Spam-Score: -1.64 X-Migadu-Scanner: scn0.migadu.com X-TUID: wG5VYBY7T6Ij This fixes one of the bugs reported by Gregor in [1]. [1]: id:87edxw8jp4.fsf@no.workgroup --- emacs/notmuch-show.el | 4 ++-- test/T450-emacs-show.sh | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 1bc3b319..527db4bb 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -1811,10 +1811,10 @@ current thread." ;; dme: Would it make sense to use a macro for many of these? -;; XXX TODO figure out what to do about multiple filenames (defun notmuch-show-get-filename () "Return the filename of the current message." - (car (notmuch-show-get-prop :filename))) + (let ((duplicate (or (notmuch-show-get-prop :duplicate) 1))) + (nth (1- duplicate) (notmuch-show-get-prop :filename)))) (defun notmuch-show-get-header (header &optional props) "Return the named header of the current message, if any." diff --git a/test/T450-emacs-show.sh b/test/T450-emacs-show.sh index 2cebd43d..ab611d56 100755 --- a/test/T450-emacs-show.sh +++ b/test/T450-emacs-show.sh @@ -352,7 +352,6 @@ test_expect_equal "$output" "$subject" FILE3=$(notmuch search --output=files --duplicate=3 "id:${ID3}") test_begin_subtest "duplicate=3, stash" -test_subtest_known_broken test_emacs_expect_t \ "(notmuch-show \"id:${ID3}\") (notmuch-show-choose-duplicate 3) -- 2.35.2