From: Ali Polatel <alip@exherbo.org>
To: David Bremner <bremner@unb.ca>
Cc: Ali Polatel <alip@exherbo.org>, notmuch@notmuchmail.org
Subject: [PATCH 2/4] ruby: Add wrapper for notmuch_query_add_tag_exclude
Date: Mon, 7 May 2012 18:02:44 +0300 [thread overview]
Message-ID: <9801542fe554d17264dab0b59bd8e478905b6d2c.1336402558.git.alip@exherbo.org> (raw)
In-Reply-To: <cover.1336402558.git.alip@exherbo.org>
In-Reply-To: <cover.1336402558.git.alip@exherbo.org>
---
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
next prev parent reply other threads:[~2012-05-07 15:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87txzsgs4g.fsf@zancas.localnet>
2012-05-07 15:02 ` [PATCH 0/4] ruby: quick update before the freeze! Ali Polatel
2012-05-07 15:02 ` [PATCH 1/4] ruby: Add wrapper for notmuch_query_count_messages Ali Polatel
2012-05-07 15:02 ` Ali Polatel [this message]
2012-05-07 15:02 ` [PATCH 3/4] ruby: Add workarounds to use in-tree build not the installed one Ali Polatel
2012-05-23 22:02 ` Felipe Contreras
2012-05-24 1:22 ` David Bremner
2012-05-24 8:56 ` Felipe Contreras
2012-05-25 13:13 ` Felipe Contreras
2012-05-26 0:38 ` David Bremner
2012-05-07 15:02 ` [PATCH 4/4] ruby: Add wrapper for notmuch_query_set_omit_excluded() Ali Polatel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9801542fe554d17264dab0b59bd8e478905b6d2c.1336402558.git.alip@exherbo.org \
--to=alip@exherbo.org \
--cc=bremner@unb.ca \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).