unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Sandra Snan <sandra.snan@idiomdrottning.org>
To: notmuch@notmuchmail.org
Cc: Sandra Snan <sandra.snan@idiomdrottning.org>
Subject: [PATCH 1/2] Add notmuch-search-unthread-thread
Date: Thu,  7 Dec 2023 18:02:46 +0100	[thread overview]
Message-ID: <20231207170247.504315-1-sandra.snan@idiomdrottning.org> (raw)

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

             reply	other threads:[~2023-12-07 17:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07 17:02 Sandra Snan [this message]
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

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=20231207170247.504315-1-sandra.snan@idiomdrottning.org \
    --to=sandra.snan@idiomdrottning.org \
    --cc=notmuch@notmuchmail.org \
    /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).