unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 1/2] Add notmuch-search-unthread-thread
@ 2023-12-07 17:02 Sandra Snan
  2023-12-07 17:02 ` [PATCH 2/2] Add notmuch-search-show-or-unthread Sandra Snan
  2024-07-25 11:24 ` [PATCH 1/2] Add notmuch-search-unthread-thread David Bremner
  0 siblings, 2 replies; 6+ messages in thread
From: Sandra Snan @ 2023-12-07 17:02 UTC (permalink / raw)
  To: notmuch; +Cc: Sandra Snan

I'm in threads with many thousands of emails. So with this new
`notmuch-search-unthread-thread`, I can be in my normal daily
notmuch-search of tag:inbox and tag:personal and if I put my cursor on
at rhead and then run this command, I get a buffer with the messages
from that thread in a flat list. (Because so huge are the threads that
`notmuch-tree-from-search-thread` can't handle them either.)

And then from that "exploded view" of a thread I can go to messages
one at a time in a non-borking way and then hit q to go back to the
exploded view.
---
 emacs/notmuch.el | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 6eef4af1..c8f53625 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -547,6 +547,23 @@ Return non-nil on success."
       (message "End of search results.")
       nil)))
 
+(defun notmuch-search-unthread-thread (&optional entire)
+  "View the relevant parts of the currently selected thread
+as single messages.
+
+Without a prefix, it only shows the messages from the thread that
+match the search query. With a prefix, it shows the entire
+thread.
+
+Return non-nil on success."
+  (interactive "P")
+  (let ((thread-id (notmuch-search-find-thread-id)))
+    (if thread-id
+	(notmuch-unthreaded (if entire thread-id
+			      (concat notmuch-search-query-string " and " thread-id)))
+      (message "No such thread with that id found!")
+      nil)))
+
 (defun notmuch-tree-from-search-current-query ()
   "Tree view of current query."
   (interactive)
-- 
2.39.2

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

end of thread, other threads:[~2024-07-29 11:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-07 17:02 [PATCH 1/2] Add notmuch-search-unthread-thread Sandra Snan
2023-12-07 17:02 ` [PATCH 2/2] Add notmuch-search-show-or-unthread Sandra Snan
2024-07-25 11:32   ` David Bremner
2024-07-26  9:02     ` Sandra Snan
2024-07-29 11:04       ` David Bremner
2024-07-25 11:24 ` [PATCH 1/2] Add notmuch-search-unthread-thread David Bremner

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).