]> git.notmuchmail.org Git - notmuch/commitdiff
emacs/tree: return true if a thread was found in next-thread
authorWilliam Casarin <jb55@jb55.com>
Sat, 4 Apr 2020 20:41:31 +0000 (13:41 -0700)
committerDavid Bremner <david@tethera.net>
Mon, 6 Apr 2020 10:14:32 +0000 (07:14 -0300)
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>
emacs/notmuch-tree.el

index 9a83292c27bb20225da295e815401a6032dcf0fb..1bcf6cf9b176023c7436fd74a30310f68b0aeae2 100644 (file)
@@ -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