unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: notmuch@notmuchmail.org
Cc: David Bremner <david@tethera.net>
Subject: [PATCH 3/3] emacs/tree use notmuch-show-single-message
Date: Thu,  3 Jun 2021 08:55:00 -0300	[thread overview]
Message-ID: <20210603115500.987504-4-david@tethera.net> (raw)
In-Reply-To: <20210603115500.987504-1-david@tethera.net>

This is more efficient that notmuch-show-only-matching-messages, since
we do not parse the potentially large thread structure to find a
single message.

This is only a partial fix for notmuch-tree view, because displaying
the thread structure in the tree-mode window still crashes on long
threads. It is however enough to make unthreaded view handle long
threads.
---
 emacs/notmuch-tree.el         | 6 ++++--
 test/T465-emacs-unthreaded.sh | 1 -
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index 13007a13..605c0593 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -574,7 +574,7 @@ NOT change the database."
       (with-selected-window notmuch-tree-message-window
 	(let (;; Since we are only displaying one message do not indent.
 	      (notmuch-show-indent-messages-width 0)
-	      (notmuch-show-only-matching-messages t)
+	      (notmuch-show-single-message t)
 	      ;; Ensure that `pop-to-buffer-same-window' uses the
 	      ;; window we want it to use.
 	      (display-buffer-overriding-action
@@ -598,7 +598,9 @@ NOT change the database."
     (when id
       ;; We close the window to kill off un-needed buffers.
       (notmuch-tree-close-message-window)
-      (notmuch-show id))))
+      ;; n-s-s-m is buffer local, so use inner let.
+      (let ((notmuch-show-single-message t))
+	(notmuch-show id)))))
 
 (defun notmuch-tree-show-message (arg)
   "Show the current message.
diff --git a/test/T465-emacs-unthreaded.sh b/test/T465-emacs-unthreaded.sh
index f9abcebd..0dc52f3a 100755
--- a/test/T465-emacs-unthreaded.sh
+++ b/test/T465-emacs-unthreaded.sh
@@ -28,7 +28,6 @@ test_emacs '(let ((max-lisp-eval-depth 10))
 test_expect_equal_file EXPECTED.unthreaded OUTPUT
 
 test_begin_subtest "message from large thread (status)"
-test_subtest_known_broken
 output=$(test_emacs '(let ((max-lisp-eval-depth 10))
 		       (notmuch-unthreaded "subject:large-thread")
 		       (notmuch-test-wait)
-- 
2.30.2

  parent reply	other threads:[~2021-06-03 11:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-03 11:54 Handle long threads in unthreaded-view David Bremner
2021-06-03 11:54 ` [PATCH 1/3] test: start test file for emacs unthreaded view David Bremner
2021-06-03 11:54 ` [PATCH 2/3] emacs/show: add parameter notmuch-show-single-message David Bremner
2021-06-03 11:55 ` David Bremner [this message]
     [not found] <20210626120428.153445-1-david@tethera.net>
2021-06-26 12:04 ` [PATCH 3/3] emacs/tree use notmuch-show-single-message David Bremner
2021-06-27 17:48   ` 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=20210603115500.987504-4-david@tethera.net \
    --to=david@tethera.net \
    --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).