unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: bind C-u Z to notmuch-tree-from-search-thread
@ 2019-11-13  8:00 William Casarin
  2019-11-13  9:35 ` David Edmondson
  2019-11-13 17:34 ` Teemu Likonen
  0 siblings, 2 replies; 5+ messages in thread
From: William Casarin @ 2019-11-13  8:00 UTC (permalink / raw)
  To: notmuch; +Cc: Teemu Likonen, Johan Parin, David Edmondson, William Casarin

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@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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-11-13 17:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-13  8:00 [PATCH] emacs: bind C-u Z to notmuch-tree-from-search-thread William Casarin
2019-11-13  9:35 ` David Edmondson
2019-11-13  9:37   ` William Casarin
2019-11-13 17:34 ` Teemu Likonen
2019-11-13 17:48   ` William Casarin

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).