[PATCH 2/4] ruby: Add wrapper for notmuch_query_add_tag_exclude
authorAli Polatel <alip@exherbo.org>
Mon, 7 May 2012 15:02:44 +0000 (18:02 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:46:58 +0000 (09:46 -0800)
b6/f65ae210fd5a9ace564dc665cb2c271ba935cc [new file with mode: 0644]

diff --git a/b6/f65ae210fd5a9ace564dc665cb2c271ba935cc b/b6/f65ae210fd5a9ace564dc665cb2c271ba935cc
new file mode 100644 (file)
index 0000000..34a839c
--- /dev/null
@@ -0,0 +1,134 @@
+Return-Path: <polatel@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 C03D8431FDE\r
+       for <notmuch@notmuchmail.org>; Mon,  7 May 2012 08:03:40 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.699\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, 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 6EQbIcSgZn2E for <notmuch@notmuchmail.org>;\r
+       Mon,  7 May 2012 08:03:39 -0700 (PDT)\r
+Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com\r
+ [74.125.82.45])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ 592E1431FAE   for <notmuch@notmuchmail.org>; Mon,  7 May 2012 08:03:36 -0700\r
+ (PDT)\r
+Received: by mail-wg0-f45.google.com with SMTP id dt14so4053259wgb.2\r
+       for <notmuch@notmuchmail.org>; Mon, 07 May 2012 08:03:36 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to\r
+       :references:in-reply-to:references:organization;\r
+       bh=XvhQBKPShx6l/VogdD126fnI76wXC4VL7YkOji8DYts=;\r
+       b=ANLHCxNFCnIBgO8gJTWnsYEse5aszT1XBrSdikVqIZM4G6L2qkTB2F78j5rMeQGAwM\r
+       uxSCKnJs7IiWjZBpK/LVedEbYS2i3Q3XQpZjt30KfvvoUeSIx9iV9cPeLM8rO5oOnhpD\r
+       pA9utJAwhfo05+BCzomkOmQLdzOp/GscdhDUyGHGIb7tzVSzIlr6/8UZwSuejmu8HoFH\r
+       ieAa563L+JVRjPJPnRxX7uyPeG4TKs5myNZAdHKKP7zmPSEGOaXD3b+CLkXH3XeAwFlh\r
+       pmGoeXImnim89RrquapziOE2I7LULRyjyq8jSB4mKgWONRsY6z05N/MzQ5mjhEIMVEKb\r
+       jf8g==\r
+Received: by 10.180.102.101 with SMTP id fn5mr7159033wib.6.1336403016067;\r
+       Mon, 07 May 2012 08:03:36 -0700 (PDT)\r
+Received: from hayalet.ev ([88.234.38.242])\r
+       by mx.google.com with ESMTPS id ff2sm34852610wib.9.2012.05.07.08.03.34\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Mon, 07 May 2012 08:03:35 -0700 (PDT)\r
+Sender: Ali Polatel <polatel@gmail.com>\r
+From: Ali Polatel <alip@exherbo.org>\r
+To: David Bremner <bremner@unb.ca>\r
+Subject: [PATCH 2/4] ruby: Add wrapper for notmuch_query_add_tag_exclude\r
+Date: Mon,  7 May 2012 18:02:44 +0300\r
+Message-Id:\r
+ <9801542fe554d17264dab0b59bd8e478905b6d2c.1336402558.git.alip@exherbo.org>\r
+X-Mailer: git-send-email 1.7.10.1\r
+In-Reply-To: <cover.1336402558.git.alip@exherbo.org>\r
+References: <87txzsgs4g.fsf@zancas.localnet>\r
+       <cover.1336402558.git.alip@exherbo.org>\r
+In-Reply-To: <cover.1336402558.git.alip@exherbo.org>\r
+References: <cover.1336402558.git.alip@exherbo.org>\r
+Organization: Pink Floyd\r
+Cc: Ali Polatel <alip@exherbo.org>, notmuch@notmuchmail.org\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: Mon, 07 May 2012 15:03:41 -0000\r
+\r
+---\r
+ bindings/ruby/defs.h  |    3 +++\r
+ bindings/ruby/init.c  |    1 +\r
+ bindings/ruby/query.c |   18 ++++++++++++++++++\r
+ 3 files changed, 22 insertions(+)\r
+\r
+diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h\r
+index 25222a6..a41cf10 100644\r
+--- a/bindings/ruby/defs.h\r
++++ b/bindings/ruby/defs.h\r
+@@ -217,6 +217,9 @@ VALUE\r
+ notmuch_rb_query_get_string (VALUE self);\r
+ \r
+ VALUE\r
++notmuch_rb_query_add_tag_exclude (VALUE self, VALUE tagv);\r
++\r
++VALUE\r
+ notmuch_rb_query_search_threads (VALUE self);\r
+ \r
+ VALUE\r
+diff --git a/bindings/ruby/init.c b/bindings/ruby/init.c\r
+index 7ad0ecf..edcf101 100644\r
+--- a/bindings/ruby/init.c\r
++++ b/bindings/ruby/init.c\r
+@@ -234,6 +234,7 @@ Init_notmuch (void)\r
+     rb_define_method (notmuch_rb_cQuery, "sort", notmuch_rb_query_get_sort, 0); /* in query.c */\r
+     rb_define_method (notmuch_rb_cQuery, "sort=", notmuch_rb_query_set_sort, 1); /* in query.c */\r
+     rb_define_method (notmuch_rb_cQuery, "to_s", notmuch_rb_query_get_string, 0); /* in query.c */\r
++    rb_define_method (notmuch_rb_cQuery, "add_tag_exclude", notmuch_rb_query_add_tag_exclude, 1); /* in query.c */\r
+     rb_define_method (notmuch_rb_cQuery, "search_threads", notmuch_rb_query_search_threads, 0); /* in query.c */\r
+     rb_define_method (notmuch_rb_cQuery, "search_messages", notmuch_rb_query_search_messages, 0); /* in query.c */\r
+     rb_define_method (notmuch_rb_cQuery, "count_messages", notmuch_rb_query_count_messages, 0); /* in query.c */\r
+diff --git a/bindings/ruby/query.c b/bindings/ruby/query.c\r
+index 02b7819..2a80008 100644\r
+--- a/bindings/ruby/query.c\r
++++ b/bindings/ruby/query.c\r
+@@ -89,6 +89,24 @@ notmuch_rb_query_get_string (VALUE self)\r
+ }\r
+ \r
+ /*\r
++ * call-seq: QUERY.add_tag_exclude(tag) => nil\r
++ *\r
++ * Add a tag that will be excluded from the query results by default.\r
++ */\r
++VALUE\r
++notmuch_rb_query_add_tag_exclude (VALUE self, VALUE tagv)\r
++{\r
++    notmuch_query_t *query;\r
++    const char *tag;\r
++\r
++    Data_Get_Notmuch_Query (self, query);\r
++    tag = RSTRING_PTR(tagv);\r
++\r
++    notmuch_query_add_tag_exclude(query, tag);\r
++    return Qnil;\r
++}\r
++\r
++/*\r
+  * call-seq: QUERY.search_threads => THREADS\r
+  *\r
+  * Search for threads\r
+-- \r
+1.7.10.1\r
+\r