unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: William Casarin <jb55@jb55.com>
To: notmuch@notmuchmail.org
Cc: Teemu Likonen <tlikonen@iki.fi>,
	Johan Parin <johanparin@gmail.com>, David Edmondson <dme@dme.org>,
	William Casarin <jb55@jb55.com>
Subject: [PATCH] emacs: bind C-u Z to notmuch-tree-from-search-thread
Date: Wed, 13 Nov 2019 00:00:04 -0800	[thread overview]
Message-ID: <20191113080004.32214-1-jb55@jb55.com> (raw)

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

             reply	other threads:[~2019-11-13  8:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-13  8:00 William Casarin [this message]
2019-11-13  9:35 ` [PATCH] emacs: bind C-u Z to notmuch-tree-from-search-thread David Edmondson
2019-11-13  9:37   ` William Casarin
2019-11-13 17:34 ` Teemu Likonen
2019-11-13 17:48   ` William Casarin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191113080004.32214-1-jb55@jb55.com \
    --to=jb55@jb55.com \
    --cc=dme@dme.org \
    --cc=johanparin@gmail.com \
    --cc=notmuch@notmuchmail.org \
    --cc=tlikonen@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).