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

diff --git a/79/4562292ffe1a589918c9fee08713a5d6514147 b/79/4562292ffe1a589918c9fee08713a5d6514147
new file mode 100644 (file)
index 0000000..054e4b4
--- /dev/null
@@ -0,0 +1,147 @@
+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 91040431FC9\r
+       for <notmuch@notmuchmail.org>; Mon,  7 May 2012 08:03:48 -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 saRnYI04txUL for <notmuch@notmuchmail.org>;\r
+       Mon,  7 May 2012 08:03:46 -0700 (PDT)\r
+Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com\r
+       [209.85.212.173]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id A5C95431FAE\r
+       for <notmuch@notmuchmail.org>; Mon,  7 May 2012 08:03:42 -0700 (PDT)\r
+Received: by mail-wi0-f173.google.com with SMTP id hn9so512021wib.2\r
+       for <notmuch@notmuchmail.org>; Mon, 07 May 2012 08:03:42 -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=KJ6dlpCBBO0JoABouOyzd3ETZF+RaIwFbLrah1ZwmU4=;\r
+       b=LGMOcc71jMlTJx7Gx7I/Y/agiWfo/znXHYm6USkfQGhfmmdthicpQft1IbnvbCzpGj\r
+       Zsq3LUmLbPLbqsYVB85hZm+WCQTfxekyBwR0PwqQmgTUK+sRUmJhaLBA0mSfXNH2l2xL\r
+       +mkWfx4/JVRx9RVof4o9lVkIC9qjl6yoqoGAT4r0+DPObjWioGeYqJHnwRUf+dcK7Lge\r
+       y5/SZiUgFzN0nEM3UY+VvIBqvIfWQXzthklVpZ5rG04Y7Up2h/vkaSljioBFAumCK5e/\r
+       ltXvPfEAMLPVjemEsaTIB7/o3rjGID6XtAwkbPA0KyXFaYZOyQ1YoL1I6QDOGPCS7Ogb\r
+       E1ww==\r
+Received: by 10.180.76.232 with SMTP id n8mr14584451wiw.2.1336403022349;\r
+       Mon, 07 May 2012 08:03:42 -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.41\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Mon, 07 May 2012 08:03:41 -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 4/4] ruby: Add wrapper for notmuch_query_set_omit_excluded()\r
+Date: Mon,  7 May 2012 18:02:46 +0300\r
+Message-Id:\r
+ <397b5f460e19925d22a3c9ea5d81bb3fdc715029.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:49 -0000\r
+\r
+---\r
+ bindings/ruby/defs.h  |    3 +++\r
+ bindings/ruby/init.c  |    7 +++++++\r
+ bindings/ruby/query.c |   18 ++++++++++++++++++\r
+ 3 files changed, 28 insertions(+)\r
+\r
+diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h\r
+index 6fe5787..85d8205 100644\r
+--- a/bindings/ruby/defs.h\r
++++ b/bindings/ruby/defs.h\r
+@@ -220,6 +220,9 @@ VALUE\r
+ notmuch_rb_query_add_tag_exclude (VALUE self, VALUE tagv);\r
+ \r
+ VALUE\r
++notmuch_rb_query_set_omit_excluded (VALUE self, VALUE omitv);\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 edcf101..3fe60fb 100644\r
+--- a/bindings/ruby/init.c\r
++++ b/bindings/ruby/init.c\r
+@@ -96,6 +96,12 @@ Init_notmuch (void)\r
+      */\r
+     rb_define_const (mod, "MESSAGE_FLAG_MATCH", INT2FIX (NOTMUCH_MESSAGE_FLAG_MATCH));\r
+     /*\r
++     * Document-const: Notmuch::MESSAGE_FLAG_EXCLUDED\r
++     *\r
++     * Message flag "excluded"\r
++     */\r
++    rb_define_const (mod, "MESSAGE_FLAG_EXCLUDED", INT2FIX (NOTMUCH_MESSAGE_FLAG_EXCLUDED));\r
++    /*\r
+      * Document-const: Notmuch::TAG_MAX\r
+      *\r
+      * Maximum allowed length of a tag\r
+@@ -235,6 +241,7 @@ Init_notmuch (void)\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, "omit_excluded=", notmuch_rb_query_set_omit_excluded, 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 2a80008..e5ba1b7 100644\r
+--- a/bindings/ruby/query.c\r
++++ b/bindings/ruby/query.c\r
+@@ -107,6 +107,24 @@ notmuch_rb_query_add_tag_exclude (VALUE self, VALUE tagv)\r
+ }\r
+ \r
+ /*\r
++ * call-seq: QUERY.omit_excluded=(boolean) => nil\r
++ *\r
++ * Specify whether to omit excluded results or simply flag them.\r
++ * By default, this is set to +true+.\r
++ */\r
++VALUE\r
++notmuch_rb_query_set_omit_excluded (VALUE self, VALUE omitv)\r
++{\r
++    notmuch_query_t *query;\r
++\r
++    Data_Get_Notmuch_Query (self, query);\r
++\r
++    notmuch_query_set_omit_excluded (query, RTEST (omitv));\r
++\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