unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Vim: Respect excluded tags when showing a thread
@ 2021-02-16 23:43 Jules Aguillon
  2021-02-16 23:43 ` [PATCH 2/2] Vim: Ensure that every queries respect excluded tags Jules Aguillon
  0 siblings, 1 reply; 2+ messages in thread
From: Jules Aguillon @ 2021-02-16 23:43 UTC (permalink / raw)
  To: notmuch; +Cc: 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

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

* [PATCH 2/2] Vim: Ensure that every queries respect excluded tags
  2021-02-16 23:43 [PATCH 1/2] Vim: Respect excluded tags when showing a thread Jules Aguillon
@ 2021-02-16 23:43 ` Jules Aguillon
  0 siblings, 0 replies; 2+ messages in thread
From: Jules Aguillon @ 2021-02-16 23:43 UTC (permalink / raw)
  To: notmuch; +Cc: Jules Aguillon

This makes sure that the bug solved by the previous commit won't happen again
and remove some dupplication.
This shouldn't have any side effect.
---
 vim/notmuch.vim | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/vim/notmuch.vim b/vim/notmuch.vim
index 4c7add3b..d5f4f3a7 100644
--- a/vim/notmuch.vim
+++ b/vim/notmuch.vim
@@ -317,9 +317,6 @@ 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)
@@ -643,9 +640,6 @@ ruby << EOF
 			$searches.clear
 			folders.each do |name, search|
 				q = $curbuf.query(search)
-				$exclude_tags.each { |t|
-					q.add_tag_exclude(t)
-				}
 				$searches << search
 				count = count_threads ? q.count_threads : q.count_messages
 				b << "%9d %-20s (%s)" % [count, name, search]
@@ -657,9 +651,6 @@ ruby << EOF
 		date_fmt = VIM::evaluate('g:notmuch_date_format')
 		q = $curbuf.query(search)
 		q.sort = Notmuch::SORT_NEWEST_FIRST
-		$exclude_tags.each { |t|
-			q.add_tag_exclude(t)
-		}
 		$threads.clear
 		t = q.search_threads
 
@@ -711,6 +702,9 @@ ruby << EOF
 		def query(*args)
 			q = @db.query(*args)
 			@queries << q
+			$exclude_tags.each { |t|
+			    q.add_tag_exclude(t)
+			}
 			q
 		end
 
-- 
2.30.0

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

end of thread, other threads:[~2021-02-16 23:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-16 23:43 [PATCH 1/2] Vim: Respect excluded tags when showing a thread Jules Aguillon
2021-02-16 23:43 ` [PATCH 2/2] Vim: Ensure that every queries respect excluded tags Jules Aguillon

unofficial mirror of notmuch@notmuchmail.org

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/notmuch/0 notmuch/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 notmuch notmuch/ https://yhetil.org/notmuch \
		notmuch@notmuchmail.org
	public-inbox-index notmuch

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.mail.notmuch.general
	nntp://news.gmane.io/gmane.mail.notmuch.general


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git