[PATCH] VIM: Respect exclude_tags specified in .notmuch-config
authorFranz Fellner <alpine.art.de@gmail.com>
Fri, 17 Oct 2014 16:07:50 +0000 (18:07 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:05:19 +0000 (10:05 -0800)
98/2552d30c0eebac46ca40d98f05875a3e7ef03c [new file with mode: 0644]

diff --git a/98/2552d30c0eebac46ca40d98f05875a3e7ef03c b/98/2552d30c0eebac46ca40d98f05875a3e7ef03c
new file mode 100644 (file)
index 0000000..e9789b8
--- /dev/null
@@ -0,0 +1,102 @@
+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 191E0431FB6\r
+       for <notmuch@notmuchmail.org>; Fri, 17 Oct 2014 09:07:48 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, 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 luSKUy0h497f for <notmuch@notmuchmail.org>;\r
+       Fri, 17 Oct 2014 09:07:42 -0700 (PDT)\r
+Received: from mail-wg0-f48.google.com (mail-wg0-f48.google.com\r
+ [74.125.82.48])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ 6BD9C431FAF   for <notmuch@notmuchmail.org>; Fri, 17 Oct 2014 09:07:42 -0700\r
+ (PDT)\r
+Received: by mail-wg0-f48.google.com with SMTP id k14so1250043wgh.19\r
+       for <notmuch@notmuchmail.org>; Fri, 17 Oct 2014 09:07:41 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=date:message-id:from:to:subject:mime-version:content-type\r
+       :content-disposition:content-transfer-encoding;\r
+       bh=P8jga0bxOOQnR37AuSrQiq0/Uex/e31M3/zfHi7+Jf0=;\r
+       b=zML7GcIJw+gCTIrP1tBsOoZlibdSiqtGGEHH1grSs5MhgKbcE6E4vSmOg9/D+RTLtd\r
+       0cEv9rxgKZKbrIC0ZWZ4CqPtDEPPBZLhks0/OAWWdVz9el+2KWdEpqHemZ3hL6V+HTns\r
+       my5LmDXaCSJYDQDzzhmH8KmkB3+LW81+dFoSxjoaWWhKWqe0kLfJ5XrHkEE7hzd4D8QD\r
+       3qWhX78d9acZM1ZraGR9O6+jV6X88x+YkdvjItlFGW2iigXjd+iZggXIqKY/rkpM4Edh\r
+       wNyScOSAzf3ziF7yTBqoQmO9gO0Tzf9idzKqXHa0K2IanBNWlxP3f4wdiTviMzYeTRyV\r
+       WGkA==\r
+X-Received: by 10.180.73.244 with SMTP id o20mr15473079wiv.9.1413562060884;\r
+       Fri, 17 Oct 2014 09:07:40 -0700 (PDT)\r
+Received: from localhost (p5B00C8AC.dip0.t-ipconnect.de. [91.0.200.172])\r
+       by mx.google.com with ESMTPSA id ga7sm2569484wic.5.2014.10.17.09.07.39\r
+       for <notmuch@notmuchmail.org>\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Fri, 17 Oct 2014 09:07:39 -0700 (PDT)\r
+Date: Fri, 17 Oct 2014 18:07:50 +0200\r
+Message-ID: <20141017180750.GE20696@TP_L520.localdomain>\r
+From: Franz Fellner <alpine.art.de@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] VIM: Respect exclude_tags specified in .notmuch-config\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Disposition: inline\r
+Content-Transfer-Encoding: 8bit\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: Fri, 17 Oct 2014 16:07:48 -0000\r
+\r
+commit 558719b9ea9c218117c448cf4c7bd671de14d968\r
+Author: Franz Fellner <alpine.art.de@gmail.com>\r
+Date:   Fri Oct 17 17:53:58 2014 +0200\r
+\r
+    Exclude tags specified by\r
+    notmuch config get search.exclude_tags\r
+\r
+diff --git a/vim/notmuch.vim b/vim/notmuch.vim\r
+index 5c86fcd..b8d11fe 100644\r
+--- a/vim/notmuch.vim\r
++++ b/vim/notmuch.vim\r
+@@ -647,6 +647,7 @@ ruby << EOF\r
+       $db_name = nil\r
+       $all_emails = []\r
+       $email = $email_name = $email_address = nil\r
++      $exclude_tags = []\r
+       $searches = []\r
+       $threads = []\r
+       $messages = []\r
+@@ -672,6 +673,8 @@ ruby << EOF\r
+               # Add the primary to this too as we use it for checking\r
+               # addresses when doing a reply\r
+               $all_emails.unshift($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
+@@ -924,6 +927,9 @@ ruby << EOF\r
\r
+               def query(*args)\r
+                       q = @db.query(*args)\r
++                      $exclude_tags.each { |t|\r
++                              q.add_tag_exclude(t)\r
++                      }\r
+                       @queries << q\r
+                       q\r
+               end\r