[PATCH 1/3] emacs/tree: introduce notmuch-tree-parent-buffer variable

William Casarin jb55 at jb55.com
Thu Apr 23 16:47:13 PDT 2020


This variable will be used in a similar fashion to
notmuch-show-parent-buffer. It will be used to navigate between
threads from the parent search buffer.

Signed-off-by: William Casarin <jb55 at jb55.com>
---
 emacs/notmuch-tree.el | 7 ++++++-
 emacs/notmuch.el      | 4 +++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index 701d12f8..f38fef98 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -219,6 +219,9 @@ Note the author string should not contain
   "A buffer local copy of argument open-target to the function notmuch-tree")
 (make-variable-buffer-local 'notmuch-tree-open-target)
 
+(defvar notmuch-tree-parent-buffer nil)
+(make-variable-buffer-local 'notmuch-tree-parent-buffer)
+
 (defvar notmuch-tree-message-window nil
   "The window of the message pane.
 
@@ -1037,7 +1040,7 @@ the same as for the function notmuch-tree."
 	      ")")
     notmuch-tree-basic-query))
 
-(defun notmuch-tree (&optional query query-context target buffer-name open-target unthreaded)
+(defun notmuch-tree (&optional query query-context target buffer-name open-target unthreaded parent-buffer)
   "Display threads matching QUERY in Tree View.
 
 The arguments are:
@@ -1070,6 +1073,8 @@ The arguments are:
 
   (notmuch-tree-worker query query-context target open-target unthreaded)
 
+  (setq notmuch-tree-parent-buffer parent-buffer)
+
   (setq truncate-lines t))
 
 (defun notmuch-unthreaded (&optional query query-context target buffer-name open-target)
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index f5f03244..a7cdd893 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -536,7 +536,9 @@ thread."
                 notmuch-search-query-string
 		nil
                 (notmuch-prettify-subject (notmuch-search-find-subject))
-		t))
+		t
+		nil
+		(current-buffer)))
 
 (defun notmuch-search-reply-to-thread (&optional prompt-for-sender)
   "Begin composing a reply-all to the entire current thread in a new buffer."
-- 
2.25.1



More information about the notmuch mailing list