[PATCH 1/1] emacs: Make notmuch-show-next-thread return nil on failure

Subject: [PATCH 1/1] emacs: Make notmuch-show-next-thread return nil on failure

Date: Thu, 28 Apr 2022 12:12:19 +0200

To: notmuch@notmuchmail.org

Cc: Leo Okawa Ericson

From: Leo


From: Leo Okawa Ericson <git@relevant-information.com>

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.
---
 emacs/notmuch.el | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index c9cf80dc..a6198f4e 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -525,14 +525,15 @@ (defun notmuch-search-show-thread (&optional elide-toggle)
   (let ((thread-id (notmuch-search-find-thread-id)))
     (if thread-id
 	(notmuch-show thread-id
-		      elide-toggle
-		      (current-buffer)
-		      notmuch-search-query-string
-		      ;; Name the buffer based on the subject.
-		      (format "*%s*" (truncate-string-to-width
-				      (notmuch-search-find-subject)
-				      30 nil nil t)))
-      (message "End of search results."))))
+	       elide-toggle
+	       (current-buffer)
+	       notmuch-search-query-string
+	       ;; Name the buffer based on the subject.
+	       (format "*%s*" (truncate-string-to-width
+			       (notmuch-search-find-subject)
+			       30 nil nil t)))
+      (message "End of search results.")
+      nil)))
 
 (defun notmuch-tree-from-search-current-query ()
   "Tree view of current query."
-- 
2.36.0

_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: