[PATCH 1/2] Vim: Respect excluded tags when showing a thread

Subject: [PATCH 1/2] Vim: Respect excluded tags when showing a thread

Date: Wed, 17 Feb 2021 00:43:15 +0100

To: notmuch@notmuchmail.org

Cc: Jules Aguillon

From: Jules Aguillon


Other queries have exclude_tags taken into account but this one.
This is annoying when using an excluded tag to ignore past messages from a
thread (for example the 'deleted' tag), the entire thread is shown all the
time.
---
 NEWS            | 5 +++++
 vim/notmuch.vim | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/NEWS b/NEWS
index 6484567e..325acf22 100644
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,11 @@ Library
 
 Fix for memory error in notmuch_database_get_config_list
 
+Vim
+---
+
+Respect excluded tags when showing a thread.
+
 Notmuch 0.31.2 (2020-11-08)
 ===========================
 
diff --git a/vim/notmuch.vim b/vim/notmuch.vim
index ad8b7c80..4c7add3b 100644
--- a/vim/notmuch.vim
+++ b/vim/notmuch.vim
@@ -317,6 +317,9 @@ ruby << EOF
 	$curbuf.render do |b|
 		q = $curbuf.query(get_cur_view)
 		q.sort = Notmuch::SORT_OLDEST_FIRST
+		$exclude_tags.each { |t|
+			q.add_tag_exclude(t)
+		}
 		msgs = q.search_messages
 		msgs.each do |msg|
 			m = Mail.read(msg.filename)
-- 
2.30.0
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: