[PATCH 1/7] emacs/tree: return true if a thread was found in next-thread

Subject: [PATCH 1/7] emacs/tree: return true if a thread was found in next-thread

Date: Sat, 4 Apr 2020 13:41:31 -0700

To: notmuch@notmuchmail.org

Cc:

From: William Casarin


This will allow us to pop back to parent buffers when there are no
more threads to jump to.

Signed-off-by: William Casarin <jb55@jb55.com>
---

 This is as rebased version of id:20191228150124.20630-1-jb55@jb55.com
 as requested in id:87v9mg3gut.fsf@tethera.net 

 emacs/notmuch-tree.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index 9a83292c..1bcf6cf9 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -679,10 +679,13 @@ 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)))
+    (forward-line 1))
+  (not (eobp)))
 
 (defun notmuch-tree-thread-mapcar (function)
   "Iterate through all messages in the current thread
-- 
2.25.1

_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch

Thread: