From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 07F0E6DE1040 for ; Wed, 4 Dec 2019 11:14:37 -0800 (PST) Authentication-Results: arlo.cworth.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=jb55.com header.i=@jb55.com header.b="M2eJpdb2"; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.208 X-Spam-Level: X-Spam-Status: No, score=-0.208 tagged_above=-999 required=5 tests=[AWL=-0.318, DKIM_SIGNED=0.1, T_DKIM_INVALID=0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1geeL5aDr9NP for ; Wed, 4 Dec 2019 11:14:36 -0800 (PST) Received: from jb55.com (jb55.com [45.79.91.128]) by arlo.cworth.org (Postfix) with ESMTPS id 0CED26DE0F8E for ; Wed, 4 Dec 2019 11:14:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d= jb55.com; h=from:to:subject:date:message-id; s=default; bh=5U+yHp42dCeHY0U2Q+ALORl246mHB/lZVgCnzvCVN8k=; b=M2eJpdb2DmEr1sGjYHnbrJRAwMVkEXbWd9WrFY6HGnEvQrCTMnjFh9CGFB1KpYYF9YlDqsKQITpTc9Gi32d3mWZO6/ImXsQsy9H4xO9BzE7BDAAgCN50Qj2rIwhOVgbbHeQpR6JdGQC1NZQC/Hfu77IrO+2Ob2NhsRqy3tBYUI4/J1gbhv4zp3opQuKQhsw0VIjb6UF23z+SbFjVqqeUHZBTv6sK0xn8T+VkkLvoey1+s9RaNT1/UaPoQUpFgIu2nvn9ECqXQqLkzYTnMV/SPLtoMiNSqEE/owwfoSTg/6Su7JFKUAc18NGgyKK2Ko2Z9AE+0BRjrDdAikUKA90DCA== Received: from jb55.com (S010660e327dca171.vc.shawcable.net [24.84.152.187]) by jb55.com (OpenSMTPD) with ESMTPSA id a7bddf07 TLS version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Wed, 4 Dec 2019 19:14:32 +0000 (UTC) From: William Casarin To: David Edmondson , notmuch@notmuchmail.org Subject: Re: [PATCH v2 1/8] emacs/tree: return true if a thread was found in next-thread In-Reply-To: References: <20191128161401.28844-1-jb55@jb55.com> <20191128161401.28844-2-jb55@jb55.com> Date: Wed, 04 Dec 2019 11:14:32 -0800 Message-ID: <87muc7rjhj.fsf@jb55.com> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Dec 2019 19:14:37 -0000 David Edmondson writes: > On Thursday, 2019-11-28 at 08:13:54 -08, William Casarin wrote: > >> This will allow us to pop back to parent buffers when there are no >> more threads to jump to. >> >> Signed-off-by: William Casarin >> --- >> emacs/notmuch-tree.el | 8 ++++++-- >> 1 file changed, 6 insertions(+), 2 deletions(-) >> >> diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el >> index c00315e8..4bc05160 100644 >> --- a/emacs/notmuch-tree.el >> +++ b/emacs/notmuch-tree.el >> @@ -620,10 +620,14 @@ message will be \"unarchived\", i.e. the tag changes in >> (notmuch-tree-thread-top)) >> >> (defun notmuch-tree-next-thread () >> + "Get the next thread in the current tree. Returns t if a thread was >> +found or nil if not." >> (interactive) >> (forward-line 1) >> - (while (not (or (notmuch-tree-get-prop :first) (eobp))) >> - (forward-line 1))) >> + (let (end) >> + (while (not (or (notmuch-tree-get-prop :first) (setq end (eobp)))) >> + (forward-line 1)) >> + (not end))) > > Does using the variable add much value here? It makes the code look more > strange and removing it would add the cost of just one more call to > `eobp'. agreed, will update this in the next version > >> >> (defun notmuch-tree-thread-mapcar (function) >> "Iterate through all messages in the current thread >> -- >> 2.23.0 >> >> _______________________________________________ >> notmuch mailing list >> notmuch@notmuchmail.org >> https://notmuchmail.org/mailman/listinfo/notmuch > > dme. > -- > But uh oh, I love her because, she moves in her own way.