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 F27726DE0193 for ; Thu, 28 Nov 2019 08:24:29 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.272 X-Spam-Level: X-Spam-Status: No, score=0.272 tagged_above=-999 required=5 tests=[AWL=-0.380, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_NEUTRAL=0.652, UNPARSEABLE_RELAY=0.001] 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 09TWEHyLDI9K for ; Thu, 28 Nov 2019 08:24:29 -0800 (PST) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by arlo.cworth.org (Postfix) with ESMTPS id 36C586DE00CC for ; Thu, 28 Nov 2019 08:24:29 -0800 (PST) Received: by mail-wr1-f66.google.com with SMTP id y11so28714028wrt.6 for ; Thu, 28 Nov 2019 08:24:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dme-org.20150623.gappssmtp.com; s=20150623; h=to:subject:in-reply-to:references:from:date:message-id:mime-version; bh=YFdJj1GMMY4ba3UDFaJxdgvpwRuWu5uIuTRyoRVlzIc=; b=M0c2GSpouf2LsbeDqGTJo7hG3yEn40eZvjm8hpBgwQ9aUQ7aXADp+K0KuyywsXD7mw WGCOVjmk+WfZ/lAIF7fwmTGsZZpIKGWd08fCXt8tbmEHE1CM7Uu3Vzjxz0yyKSpIt4+i PTOL6b9hQcQYEJkGmvJSsjvkUs9u+OOMm8lUWRAvGgr4LemFe16X25HQAVENrbbk6xRI ZPKcbGOZ9p5d3XHPFJCoPP5TqYE0qXT+FeI8JvfKIxaSiUL6kZF+jZUdW6h460/7X6AX oFd/eLoJ+OvB/BXJQimXp/s+xDK2uNSgdjUt+ZvIBokzsXuUvKxl/zAV1oQfywVIDwzM HgzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:subject:in-reply-to:references:from:date :message-id:mime-version; bh=YFdJj1GMMY4ba3UDFaJxdgvpwRuWu5uIuTRyoRVlzIc=; b=Mr0oPt0JMZcnGbBGuzaVnPwJ/I55RDU8SZESfYvo71AzJugX9vYqiUn0/GED4OZ1YS PFCzrQ0A9uTClbgv1TiZOfrgcS7aadglDOKoCKrIW6BD7BeJ9XvdSQbdYDhOyfy7Ppu7 8LX2Kqp8apQFL5FQC7OBRTWPq2vs6LHxMB+5I6anjlbS3l0bMjQ74hQoFaRE51Y0jkH9 KChBL5P5HC8aehidJtoO5JNZid0JmOwZqqxVevuSo9i2U61aSAl/F9eTGFVATQkf3lh9 mqN+HeHkB/EJ2NHEYCskzcEa+VZ4idd11xr4STidyBGY4h9LTD7d8A35jIR/dJVacVRN v70g== X-Gm-Message-State: APjAAAWkFkfhntTR8Nq5KSPqf5gIPuxUXfboALx88kzWXTcvtfF742MM dU8w+ECeVtY8WQrcZsHfFgSzXQ== X-Google-Smtp-Source: APXvYqyMNfKYH+7NpNPJ/YX4f6wyTUTTYTYWFFUoUnx9Y3h4hG6yhfIGjCXOZCpFGHM/qYkDqgvf5g== X-Received: by 2002:a5d:6802:: with SMTP id w2mr5971892wru.353.1574958267448; Thu, 28 Nov 2019 08:24:27 -0800 (PST) Received: from disaster-area.hh.sledj.net (disaster-area.hh.sledj.net. [81.149.164.25]) by smtp.gmail.com with ESMTPSA id k18sm24553248wrm.82.2019.11.28.08.24.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 08:24:26 -0800 (PST) Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id 7493dd00; Thu, 28 Nov 2019 16:24:25 +0000 (UTC) To: William Casarin , notmuch@notmuchmail.org Subject: Re: [PATCH v2 1/8] emacs/tree: return true if a thread was found in next-thread In-Reply-To: <20191128161401.28844-2-jb55@jb55.com> References: <20191128161401.28844-1-jb55@jb55.com> <20191128161401.28844-2-jb55@jb55.com> X-HGTTG: heart-of-gold From: David Edmondson Date: Thu, 28 Nov 2019 16:24:25 +0000 Message-ID: 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: Thu, 28 Nov 2019 16:24:30 -0000 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'. > > (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.