From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 iO/ZMNELcGJHRwAAbAwnHQ (envelope-from ) for ; Mon, 02 May 2022 18:50:25 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id +MXPMNELcGLXTwEAauVa8A (envelope-from ) for ; Mon, 02 May 2022 18:50:25 +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 488A522372 for ; Mon, 2 May 2022 18:50:25 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id ADBFE5F6DC; Mon, 2 May 2022 16:50:22 +0000 (UTC) Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [IPv6:2001:67c:2050:0:465::101]) by mail.notmuchmail.org (Postfix) with ESMTPS id C39E15F6BE for ; Mon, 2 May 2022 16:50:19 +0000 (UTC) Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (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-101.mailbox.org (Postfix) with ESMTPS id 4KsTbt2zyNz9sWR for ; Mon, 2 May 2022 18:50:18 +0200 (CEST) From: Leo Okawa Ericson To: notmuch@notmuchmail.org Subject: Re: [PATCH 1/1] emacs: Make notmuch-show-next-thread return nil on failure In-Reply-To: <87v8uqh6c3.fsf@tethera.net> References: <20220428101217.23844-1-git@relevant-information.com> <20220428101217.23844-2-git@relevant-information.com> <87v8uqh6c3.fsf@tethera.net> Date: Mon, 02 May 2022 18:50:10 +0200 Message-ID: <87bkwfubel.fsf@relevant-information.com> MIME-Version: 1.0 Message-ID-Hash: A6OLXG4EGVALASUBH6G2APCGCLBDZYZ6 X-Message-ID-Hash: A6OLXG4EGVALASUBH6G2APCGCLBDZYZ6 X-MailFrom: git@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 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=1651510225; 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=Q3JHb5Kp9YyBDUTVn1ZDpA+atyeFSIdXjNCKvdnkysE=; b=skQZMXnGPHHA7/KwOZcEPwqUjyHnLdCBJCz+VPK9VjLlyx8f/jzi9x1qDHWzNfXH8bEGII +uB9BQXxP6D6TSIoKn+vMgcHEgsHilvB7E1U/5OX0x6oWguMxcWM/BnlcY1mArQUP4vNnV AQyOdfTaPHK22J1DHW0lJA3siEMjixPa/7M/3+0l4vs/aqe1RbDabuEH9frDOBpoSRz5/Z h/Y8jAf2WY7C6WKLAigD9Wpm5dM67VjUPjxyF1NVXQ3KGEYS/63KL7bHTEsSlQQy6DaKyd ZDtcB+500GdWzz4rFD/WL5N9qKBbEievC+2O5mxasuy8yUvvTIdnGMZydkK1dg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1651510225; a=rsa-sha256; cv=none; b=GM+gVGZtE0K5jmOCPfoYnucLYIXZFZBPs2yMxpxqmDfgIZLLVq0RwY8Szx2Y31+gleI0ll n1BrcMBOabK6cJOMo2pj/SCG3V1Om9/m8hpgh1nyGQ9l8XCBmL5bE3COkNMbUN5JiFrJhd 1XE9rNBEqs2v+W1khdHF2IcgjagOnFjSKzuQPkOeT3ZS8TqEP4k63eqWlXCqE+wh4m/MSQ /MleeACXbE35+MCKx7sYr2JIFPEz6/N3AV0zbwJB3s8Cb2+gzklW4FnndMCBljCuI7hBML sLuvkPfHxTRzJxxQKotPo18C6Uflb6myjP39cxtK/NwJphIIXDBBYu4nZYbiXw== 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: -2.14 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: 488A522372 X-Spam-Score: -2.14 X-Migadu-Scanner: scn1.migadu.com X-TUID: HR6aju8YAWc5 David Bremner writes: > Leo writes: > >> 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. > > You talk about notmuch-show-next-thread, but you seem to be modifying > notmuch-search-show-thread. That actually seems like a bit of a strange > function to invoke programatically, since it deduces the argument from > the current buffer. It might be better for your code to call > notmuch-show directly, since notmuch-search-show-thread is pretty tied > to the internals of notmuch-search-mode. > I mentioned this in the reroll of the patch, but I modified notmuch-search-show-thread because the return value of notmuch-show-next-thread depends on it. In case this is an XY problem[1], what I want is the ability to go through each email in the search buffer (like notmuch-show-next-thread does), and when there are no more messages left I want to call a function. Changing notmuch-search-show-thread (and thereby notmuch-show-next-thread), seemed to be the least intrusive way to do it. [1] https://en.wikipedia.org/wiki/XY_problem /Leo