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