[PATCH v2] VIM: Exclude mails tagged with any tag specified in 'notmuch config get...
authorFranz Fellner <alpine.art.de@gmail.com>
Thu, 22 Jan 2015 12:52:47 +0000 (13:52 +0100)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:47:41 +0000 (14:47 -0700)
1e/742c6f14404f0da1e12cc065f4168e6efae99b [new file with mode: 0644]

diff --git a/1e/742c6f14404f0da1e12cc065f4168e6efae99b b/1e/742c6f14404f0da1e12cc065f4168e6efae99b
new file mode 100644 (file)
index 0000000..86b996c
--- /dev/null
@@ -0,0 +1,112 @@
+Return-Path: <alpine.art.de@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 00FD2431FC9\r
+       for <notmuch@notmuchmail.org>; Thu, 22 Jan 2015 04:52:52 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 1.639\r
+X-Spam-Level: *\r
+X-Spam-Status: No, score=1.639 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       DNS_FROM_AHBL_RHSBL=2.438, FREEMAIL_FROM=0.001,\r
+       RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id ksD95YEkKCvl for <notmuch@notmuchmail.org>;\r
+       Thu, 22 Jan 2015 04:52:48 -0800 (PST)\r
+Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com\r
+ [74.125.82.50])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ 86543431FBC   for <notmuch@notmuchmail.org>; Thu, 22 Jan 2015 04:52:48 -0800\r
+ (PST)\r
+Received: by mail-wg0-f50.google.com with SMTP id b13so1525099wgh.9\r
+       for <notmuch@notmuchmail.org>; Thu, 22 Jan 2015 04:52:47 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
+       bh=z27BLIItK08XIIhVks+AWV9mpddQEr9y9hYZjhytXyc=;\r
+       b=xNMadCg8ku3bkBLd/GvEZ+juQFARFjwe9jHsjjSLWEm71hOdGK5Y8HcG7gQ8dVbqUp\r
+       kkCmNPNH+N4KFBKlGRiv8Jmz6Pnqgyz8VVZznpsj7ifIeLSoQ11twwLcSNkxJjM6Gjkd\r
+       412baQRVHMdC3w8Q2boIjG1otQ6KtoYpd3+lRq3PvMIJm3n8XdD4QLCsKG3zFdjEpKPn\r
+       PL9n+dD+DIat+1F4mw9DyXht/uT0cwxTWTNfi1KD9kwZQxWQoiKvwldUMvuFfXcPq3DM\r
+       qrhTpaT1QGXgW/GHCG+ULqSyF7rA2jNACwjVIYcNYP49zlLTAT241Nvuf8zXmUIGpaX/\r
+       Ek2w==\r
+X-Received: by 10.180.13.7 with SMTP id d7mr4929455wic.57.1421931167285;\r
+       Thu, 22 Jan 2015 04:52:47 -0800 (PST)\r
+Received: from localhost (p4FFB8A19.dip0.t-ipconnect.de. [79.251.138.25])\r
+       by mx.google.com with ESMTPSA id ej10sm2952621wib.2.2015.01.22.04.52.45\r
+       (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+       Thu, 22 Jan 2015 04:52:45 -0800 (PST)\r
+From: Franz Fellner <alpine.art.de@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2] VIM: Exclude mails tagged with any tag specified in\r
+       'notmuch config get search.exclude_tags' in folders list and\r
+       search list.\r
+Date: Thu, 22 Jan 2015 13:52:47 +0100\r
+Message-Id: <1421931167-22066-1-git-send-email-alpine.art.de@gmail.com>\r
+X-Mailer: git-send-email 2.2.1\r
+In-Reply-To: <20141017180750.GE20696@TP_L520.localdomain>\r
+References: <20141017180750.GE20696@TP_L520.localdomain>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 22 Jan 2015 12:52:52 -0000\r
+\r
+---\r
+ vim/notmuch.vim | 9 +++++++++\r
+ 1 file changed, 9 insertions(+)\r
+\r
+diff --git a/vim/notmuch.vim b/vim/notmuch.vim\r
+index cad9517..cb6695a 100644\r
+--- a/vim/notmuch.vim\r
++++ b/vim/notmuch.vim\r
+@@ -477,6 +477,7 @@ ruby << EOF\r
\r
+       $db_name = nil\r
+       $email = $email_name = $email_address = nil\r
++      $exclude_tags = []\r
+       $searches = []\r
+       $threads = []\r
+       $messages = []\r
+@@ -496,6 +497,8 @@ ruby << EOF\r
+               $email_address = get_config_item('user.primary_email')\r
+               $email_name = get_config_item('user.name')\r
+               $email = "%s <%s>" % [$email_name, $email_address]\r
++              ignore_tags = get_config_item('search.exclude_tags')\r
++              $exclude_tags = ignore_tags.split("\n")\r
+       end\r
\r
+       def vim_puts(s)\r
+@@ -637,6 +640,9 @@ ruby << EOF\r
+                       $searches.clear\r
+                       folders.each do |name, search|\r
+                               q = $curbuf.query(search)\r
++                              $exclude_tags.each { |t|\r
++                                      q.add_tag_exclude(t)\r
++                              }\r
+                               $searches << search\r
+                               count = count_threads ? q.search_threads.count : q.search_messages.count\r
+                               b << "%9d %-20s (%s)" % [count, name, search]\r
+@@ -648,6 +654,9 @@ ruby << EOF\r
+               date_fmt = VIM::evaluate('g:notmuch_date_format')\r
+               q = $curbuf.query(search)\r
+               q.sort = Notmuch::SORT_NEWEST_FIRST\r
++              $exclude_tags.each { |t|\r
++                      q.add_tag_exclude(t)\r
++              }\r
+               $threads.clear\r
+               t = q.search_threads\r
\r
+-- \r
+2.2.1\r
+\r