[PATCH] emacs: bind C-u Z to notmuch-tree-from-search-thread

William Casarin jb55 at jb55.com
Wed Nov 13 00:00:04 PST 2019


This is an unbound function that is quite useful. It opens a selected
thread in notmuch-tree from the current search query.

Signed-off-by: William Casarin <jb55 at jb55.com>
---
 emacs/notmuch.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 773d1206..b5c361ca 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -517,10 +517,13 @@ thread."
 		      (concat "*" (truncate-string-to-width subject 30 nil nil t) "*"))
       (message "End of search results."))))
 
-(defun notmuch-tree-from-search-current-query ()
+(put 'notmuch-tree-from-search-current-query 'notmuch-prefix-doc
+     "Show the selected thread with notmuch-tree")
+(defun notmuch-tree-from-search-current-query (&optional search-thread)
   "Call notmuch tree with the current query"
-  (interactive)
-  (notmuch-tree notmuch-search-query-string))
+  (interactive "P")
+  (if search-thread (notmuch-tree-from-search-thread)
+    (notmuch-tree notmuch-search-query-string)))
 
 (defun notmuch-tree-from-search-thread ()
   "Show the selected thread with notmuch-tree"

base-commit: 7ad7cfbff232431377562271901ee00202bf0bd0
-- 
2.23.0



More information about the notmuch mailing list