unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jules Aguillon <juloo.dsi@gmail.com>
To: notmuch@notmuchmail.org
Cc: Jules Aguillon <juloo.dsi@gmail.com>
Subject: [PATCH 2/2] Vim: Ensure that every queries respect excluded tags
Date: Wed, 17 Feb 2021 00:43:16 +0100	[thread overview]
Message-ID: <20210216234316.20990-2-juloo.dsi@gmail.com> (raw)
In-Reply-To: <20210216234316.20990-1-juloo.dsi@gmail.com>

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

  reply	other threads:[~2021-02-16 23:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2021-04-28  3:41   ` [PATCH 2/2] Vim: Ensure that every queries respect excluded tags Felipe Contreras
2021-04-23 12:23 ` [PATCH 1/2] Vim: Respect excluded tags when showing a thread David Bremner
2021-04-25 16:42   ` Felipe Contreras
2021-04-26 23:39     ` David Bremner
2021-04-27 19:42       ` Felipe Contreras
2021-04-27 20:09         ` David Bremner
2021-04-27 21:49           ` Felipe Contreras
2021-04-28 10:32             ` 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=20210216234316.20990-2-juloo.dsi@gmail.com \
    --to=juloo.dsi@gmail.com \
    --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).