RE: [PATCH] VIM: Respect exclude_tags specified in .notmuch-config

Subject: RE: [PATCH] VIM: Respect exclude_tags specified in .notmuch-config

Date: Mon, 20 Oct 2014 11:12:20 -0700

To: Franz Fellner

Cc: notmuch@notmuchmail.org

From: Ian Main


Thanks Franz!

So this works well in the main searches by not showing anything I have marked
as 'spam'.  However if I force a search for tag:spam and then try to view any
of the messages presented they will not show up because of the way we display
the email..  :-/

I'm not sure what is the best way to fix this..

    Ian

Franz Fellner wrote:
> commit 558719b9ea9c218117c448cf4c7bd671de14d968
> Author: Franz Fellner <alpine.art.de@gmail.com>
> Date:   Fri Oct 17 17:53:58 2014 +0200
> 
>     Exclude tags specified by
>     notmuch config get search.exclude_tags
> 
> diff --git a/vim/notmuch.vim b/vim/notmuch.vim
> index 5c86fcd..b8d11fe 100644
> --- a/vim/notmuch.vim
> +++ b/vim/notmuch.vim
> @@ -647,6 +647,7 @@ ruby << EOF
>  	$db_name = nil
>  	$all_emails = []
>  	$email = $email_name = $email_address = nil
> +	$exclude_tags = []
>  	$searches = []
>  	$threads = []
>  	$messages = []
> @@ -672,6 +673,8 @@ ruby << EOF
>  		# Add the primary to this too as we use it for checking
>  		# addresses when doing a reply
>  		$all_emails.unshift($email_address)
> +		ignore_tags = get_config_item('search.exclude_tags')
> +		$exclude_tags = ignore_tags.split("\n")
>  	end
>  
>  	def vim_puts(s)
> @@ -924,6 +927,9 @@ ruby << EOF
>  
>  		def query(*args)
>  			q = @db.query(*args)
> +			$exclude_tags.each { |t|
> +				q.add_tag_exclude(t)
> +			}
>  			@queries << q
>  			q
>  		end
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch



Thread: