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 OAskG4WEamIq0AAAbAwnHQ (envelope-from ) for ; Thu, 28 Apr 2022 14:11:49 +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 iD1RG4WEamL4AgEA9RJhRA (envelope-from ) for ; Thu, 28 Apr 2022 14:11:49 +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 F2AC923F71 for ; Thu, 28 Apr 2022 14:11:48 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id E6A035F743; Thu, 28 Apr 2022 12:11:46 +0000 (UTC) X-Greylist: delayed 378 seconds by postgrey-1.36 at yantan; Thu, 28 Apr 2022 10:19:40 UTC Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [IPv6:2001:67c:2050:0:465::201]) by mail.notmuchmail.org (Postfix) with ESMTPS id A08F95F727 for ; Thu, 28 Apr 2022 10:19:40 +0000 (UTC) Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (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-201.mailbox.org (Postfix) with ESMTPS id 4Kps000nyRz9sqR; Thu, 28 Apr 2022 12:13:36 +0200 (CEST) From: Leo To: notmuch@notmuchmail.org Subject: [PATCH 1/1] emacs: Make notmuch-show-next-thread return nil on failure Date: Thu, 28 Apr 2022 12:12:19 +0200 Message-Id: <20220428101217.23844-2-git@relevant-information.com> In-Reply-To: <20220428101217.23844-1-git@relevant-information.com> References: <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: YEENCFJXEEJ4MENKGBYP3YIUDTJAY5EF X-Message-ID-Hash: YEENCFJXEEJ4MENKGBYP3YIUDTJAY5EF X-Mailman-Approved-At: Thu, 28 Apr 2022 12:11:44 +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=1651147909; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=lCSlzEnWDLYy6fJ59lBdENx5dj5vzVr0mb6Z3A2V4fc=; b=egopdv/lE/KJzsi6RO0ZKNY4L36HNONBsnf2KrJGjhqWPzz5jHYbk4FVm3JOAoY82gqsD4 8sebyZaCUqYy5KgislDM/3nql0te043Pd69G4Flb8QFBpdX9xaPuMolxyz/4eKlAHp5KLE olt+4W4LAvwVdZYdsCha49HIa7zuiHkpPPX6U4G4BK5GhuN2unBR92FlMjLkV0PGf/KQiZ 0Ild37fRUmLpI5S7tG3OLc6Nzm5B27D3OxtFn/QW19dNBhSU/AxY2I7u+BDTvTEd6pBqcq ETd3WJ8/OLyWEHbjXmXk2x+fsU5z+1QarTl2U2yorxfg43RB178grD8zOodICw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1651147909; a=rsa-sha256; cv=none; b=nYxzu8e78yM4ArB0BWFgsP9TrYIwgZAgcBnBFzHgZRXmWzg7qLd9YM4gc3a0ilzASITMLf mKEhCB/ShD25hFfZSPUlznYhLg9ExmrMtNFKfQrykaGZxfmUdqT/JgNRHW7jqvcYbHEK7r yeNumHDgdaGqgOi90YwLSvDID+MdFI5Shw3L9C7iN8G7IzQp9cWcT2twseQlbrpDq5zC7m W9L5H3jVzavZujGB45DC2IzOjVgKj/y6I3W2XrNpaIuH2HyWj0O0PXZmQDhL950EwTW8aX vJwbEW0tOo+5Hmgt6umuQxQRAVxiBgh2qaRFZuZRbNpypHneXgBIXzYyKAxVBg== 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: -0.23 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: F2AC923F71 X-Spam-Score: -0.23 X-Migadu-Scanner: scn1.migadu.com X-TUID: 6+j5mePDJDh5 From: Leo Okawa Ericson Having notmuch-show-next-thread return non-nil on success and nil on failure makes it easier for users to interact with notmuch via elisp. --- emacs/notmuch.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index c9cf80dc..a6198f4e 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -525,14 +525,15 @@ (defun notmuch-search-show-thread (&optional elide-toggle) (let ((thread-id (notmuch-search-find-thread-id))) (if thread-id (notmuch-show thread-id - elide-toggle - (current-buffer) - notmuch-search-query-string - ;; Name the buffer based on the subject. - (format "*%s*" (truncate-string-to-width - (notmuch-search-find-subject) - 30 nil nil t))) - (message "End of search results.")))) + elide-toggle + (current-buffer) + notmuch-search-query-string + ;; Name the buffer based on the subject. + (format "*%s*" (truncate-string-to-width + (notmuch-search-find-subject) + 30 nil nil t))) + (message "End of search results.") + nil))) (defun notmuch-tree-from-search-current-query () "Tree view of current query." -- 2.36.0