From c46842fbafc8a6f2fe8822097cc1f7972188a4d8 Mon Sep 17 00:00:00 2001 From: Ian Main Date: Tue, 21 Oct 2014 11:12:20 +1700 Subject: [PATCH] RE: [PATCH] VIM: Respect exclude_tags specified in .notmuch-config --- 5c/c9ed0090c0c14351afa09460e6ceff4ba643f6 | 120 ++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 5c/c9ed0090c0c14351afa09460e6ceff4ba643f6 diff --git a/5c/c9ed0090c0c14351afa09460e6ceff4ba643f6 b/5c/c9ed0090c0c14351afa09460e6ceff4ba643f6 new file mode 100644 index 000000000..cc2ee786e --- /dev/null +++ b/5c/c9ed0090c0c14351afa09460e6ceff4ba643f6 @@ -0,0 +1,120 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 68D8C431FAF + for ; Mon, 20 Oct 2014 11:12:32 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id XJ+8D88v1Zcf for ; + Mon, 20 Oct 2014 11:12:25 -0700 (PDT) +Received: from cmta14.telus.net (cmta14.telus.net [209.171.16.87]) + by olra.theworths.org (Postfix) with ESMTP id 30FAB431FAE + for ; Mon, 20 Oct 2014 11:12:25 -0700 (PDT) +Received: from ovo.mains.priv ([207.102.88.62]) by cmta14.telus.net with TELUS + id 5WCQ1p00B1LiWEf01WCQvp; Mon, 20 Oct 2014 12:12:24 -0600 +X-Authority-Analysis: v=2.0 cv=YvLRsfkX c=1 sm=2 + a=EcQDfIwDZEqJA1f7rVUV8Q==:17 a=K_0WnIvp2iAA:10 a=IkcTkHD0fZMA:10 + a=20KFwNOVAAAA:8 a=pGLkceISAAAA:8 a=7343-z1_AAAA:8 + a=E2VBG8G2KAZyGhUcUgUA:9 + a=QEXdDO2ut3YA:10 a=MSl-tDqOz04A:10 a=0c-eHkXYtrgA:10 + a=DT_JQ7Kj-ggUwJRE:21 + a=6UbEzHd2lRgpVt0V:21 a=EcQDfIwDZEqJA1f7rVUV8Q==:117 +X-Telus-Outbound-IP: 207.102.88.62 +Received: from ovo.mains.priv (localhost.localdomain [127.0.0.1]) + by ovo.mains.priv (8.14.8/8.14.8) with ESMTP id s9KICLS1003401; + Mon, 20 Oct 2014 11:12:23 -0700 +Received: (from imain@localhost) + by ovo.mains.priv (8.14.8/8.14.8/Submit) id s9KICKDV003400; + Mon, 20 Oct 2014 11:12:20 -0700 +X-Authentication-Warning: ovo.mains.priv: imain set sender to imain@redhat.com + using -f +Date: Mon, 20 Oct 2014 11:12:20 -0700 +From: Ian Main +To: Franz Fellner +Message-ID: <5445508493932_ce1af5e886b@ovo.mains.priv.notmuch> +In-Reply-To: <20141017180750.GE20696@TP_L520.localdomain> +References: <20141017180750.GE20696@TP_L520.localdomain> +Subject: RE: [PATCH] VIM: Respect exclude_tags specified in .notmuch-config +Mime-Version: 1.0 +Content-Type: text/plain; + charset=utf-8 +Content-Transfer-Encoding: 7bit +Cc: notmuch@notmuchmail.org +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Mon, 20 Oct 2014 18:12:32 -0000 + + +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 +> 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 + + -- 2.26.2