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 ms5.migadu.com with LMTPS id MLmtBHKEamJudwEAbAwnHQ (envelope-from ) for ; Thu, 28 Apr 2022 14:11: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 mp12.migadu.com with LMTPS id IK+9BHKEamIeAAEAauVa8A (envelope-from ) for ; Thu, 28 Apr 2022 14:11: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 9043B13A29 for ; Thu, 28 Apr 2022 14:11:29 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id A93135F733; Thu, 28 Apr 2022 12:11:26 +0000 (UTC) Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [IPv6:2001:67c:2050:0:465::102]) by mail.notmuchmail.org (Postfix) with ESMTPS id D6AC55F727 for ; Thu, 28 Apr 2022 10:20:25 +0000 (UTC) Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4Kprzj2y2Qz9sdN; Thu, 28 Apr 2022 12:13:21 +0200 (CEST) From: Leo To: notmuch@notmuchmail.org Subject: [PATCH 0/1] emacs: Make notmuch-show-next-thread return nil on failure Date: Thu, 28 Apr 2022 12:12:17 +0200 Message-Id: <20220428101217.23844-1-git@relevant-information.com> MIME-Version: 1.0 X-MailFrom: sourcehut@relevant-information.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0 Message-ID-Hash: NBQGP6QLGSN2F6NU6REYHOPMK726MFDL X-Message-ID-Hash: NBQGP6QLGSN2F6NU6REYHOPMK726MFDL X-Mailman-Approved-At: Thu, 28 Apr 2022 12:11:25 +0000 CC: Leo Okawa Ericson 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=1651147889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=Zwt/pQM3x3kyc1aOEMlWjqFtxetPr/1IgSmfV1suPeM=; b=miYtPopv0JnYnuBEbeGLUQ80fBL5XsdLKjHlFfIpnrYonzu0gOJLZjuJn+7k3STCv5OXhA X0yUDQa1ojNaU6O/b/ff9ojNna970pv8oYECdHZuQ2Sxb3DHRHpJQHUlFhP+4v+Cj+BalN xTvkCxUo7Km+cZ3QftHs07T0oSQE+VLx6EWM1OCBOer8ctdN+8PApo71UIwjkRdzY2wo7q aoBFwpcs4aXNKLseZEdGAq1wsgy1gu2P8EPiZldYhSujLd2NCBG1sbBac2AnYEYjAh9UEl TEdxM8bffCqeEJ6tOX/IO+JAT46cB8VHLQOisP8t5ZCLP9AcuW/hkoiL8VeSMg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1651147889; a=rsa-sha256; cv=none; b=lrfRfb/a2lBCaBmgLXPK74O8O8pF4SqEZShDgZG4XrTM1BGkWJ01zGFguYe3VfTtzElkUn jyunFlT31D5Jx3N2rqtSUGujRA6zBa4k4ur60fCn2olyvxKrU7SfEcQ3bYZrWtO2FWYiZX F0xwftnhMFzcJFjoRWGt+c8mz6+yMtdtMjJRv3715KsNg+wJZDTU3IqwTQ7D7JhrgnOQqa lQo0NqtBWjVBRGeW01Nj6iZr1rwEYrXpbIryvG10+ODL8aAEhQbvcH9FvNQD2bI+sfuqVe SL8CEuQcVpfkRy1CuVJHWIQYSFLBCQkg+QgYrhXtPa7EUKYxeXdt8H/uB5tGEg== 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: -0.82 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: 9043B13A29 X-Spam-Score: -0.82 X-Migadu-Scanner: scn1.migadu.com X-TUID: aES1IvofLtwk From: Leo Okawa Ericson Hello, First some context on why I personally want this change. I am developing a package that allows users to interact with notmuch in a specific way. In particular, I need to know when notmuch-show-next-thread succeeds or fails (there are no more messages for this query). See [1] for how I'm currently using notmuch. I've implemented that change in this patch. I've tested it manually, but didn't understand how to make the test I wrote to work properly, so I haven't included that in the patch. Here is a basic test I tried to write in test/T450-emacs-show.sh, but the first "assert" fails. > test_begin_subtest "notmuch-search-show-thread returns non-nil on success" > test_emacs_expect_t '(notmuch-search "id:20091117203301.GV3165@dottiness.seas.harvard.edu") > (unless (notmuch-search-show-thread) > (error "Expected non-nil when successfully showing a thread")) > (when (notmuch-show-next-thread) > (error "Expected nil when there are no more threads")) > t' [1] https://git.sr.ht/~zetagon/el-secretario/tree/ab0572477ab2bdb2364256dd884555b052705659/item/el-secretario-notmuch.el#L109 Leo Okawa Ericson (1): emacs: Make notmuch-show-next-thread return nil on failure emacs/notmuch.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) base-commit: e3ad0087f3453c89871acac8b11da8bab1ac54df -- 2.36.0