unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Ali Polatel <polatel@gmail.com>
To: Austin Clements <amdragon@MIT.EDU>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH 6/6] ruby: Add bindings for notmuch_thread_get_messages
Date: Mon, 26 Nov 2012 18:23:16 +0200	[thread overview]
Message-ID: <20121126162316.GB5669@hayalet> (raw)
In-Reply-To: <1353819427-13182-7-git-send-email-amdragon@mit.edu>

[-- Attachment #1: Type: text/plain, Size: 2776 bytes --]

LGTM. Thanks for showing love to the ruby bindings as I was away.

On Sat, Nov 24, 2012 at 11:57:07PM -0500, Austin Clements wrote:
>---
> bindings/ruby/defs.h   |    3 +++
> bindings/ruby/init.c   |    1 +
> bindings/ruby/thread.c |   20 ++++++++++++++++++++
> 3 files changed, 24 insertions(+)
>
>diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h
>index fe81b3f..5b44585 100644
>--- a/bindings/ruby/defs.h
>+++ b/bindings/ruby/defs.h
>@@ -262,6 +262,9 @@ VALUE
> notmuch_rb_thread_get_toplevel_messages (VALUE self);
>
> VALUE
>+notmuch_rb_thread_get_messages (VALUE self);
>+
>+VALUE
> notmuch_rb_thread_get_matched_messages (VALUE self);
>
> VALUE
>diff --git a/bindings/ruby/init.c b/bindings/ruby/init.c
>index f4931d3..663271d 100644
>--- a/bindings/ruby/init.c
>+++ b/bindings/ruby/init.c
>@@ -306,6 +306,7 @@ Init_notmuch (void)
>     rb_define_method (notmuch_rb_cThread, "thread_id", notmuch_rb_thread_get_thread_id, 0); /* in thread.c */
>     rb_define_method (notmuch_rb_cThread, "total_messages", notmuch_rb_thread_get_total_messages, 0); /* in thread.c */
>     rb_define_method (notmuch_rb_cThread, "toplevel_messages", notmuch_rb_thread_get_toplevel_messages, 0); /* in thread.c */
>+    rb_define_method (notmuch_rb_cThread, "messages", notmuch_rb_thread_get_messages, 0); /* in thread.c */
>     rb_define_method (notmuch_rb_cThread, "matched_messages", notmuch_rb_thread_get_matched_messages, 0); /* in thread.c */
>     rb_define_method (notmuch_rb_cThread, "authors", notmuch_rb_thread_get_authors, 0); /* in thread.c */
>     rb_define_method (notmuch_rb_cThread, "subject", notmuch_rb_thread_get_subject, 0); /* in thread.c */
>diff --git a/bindings/ruby/thread.c b/bindings/ruby/thread.c
>index efe5aaf..56616d9 100644
>--- a/bindings/ruby/thread.c
>+++ b/bindings/ruby/thread.c
>@@ -92,6 +92,26 @@ notmuch_rb_thread_get_toplevel_messages (VALUE self)
> }
>
> /*
>+ * call-seq: THREAD.messages => MESSAGES
>+ *
>+ * Get a Notmuch::Messages iterator for the all messages in thread.
>+ */
>+VALUE
>+notmuch_rb_thread_get_messages (VALUE self)
>+{
>+    notmuch_messages_t *messages;
>+    notmuch_thread_t *thread;
>+
>+    Data_Get_Notmuch_Thread (self, thread);
>+
>+    messages = notmuch_thread_get_messages (thread);
>+    if (!messages)
>+	rb_raise (notmuch_rb_eMemoryError, "Out of memory");
>+
>+    return Data_Wrap_Struct (notmuch_rb_cMessages, NULL, NULL, messages);
>+}
>+
>+/*
>  * call-seq: THREAD.matched_messages => fixnum
>  *
>  * Get the number of messages in thread that matched the search
>-- 
>1.7.10.4
>
>_______________________________________________
>notmuch mailing list
>notmuch@notmuchmail.org
>http://notmuchmail.org/mailman/listinfo/notmuch

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2012-11-26 16:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-25  4:57 [PATCH 0/6] API for iterating over all messages in a thread Austin Clements
2012-11-25  4:57 ` [PATCH 1/6] lib: Clean up error handling in _notmuch_thread_create Austin Clements
2013-02-19  1:13   ` David Bremner
2013-02-19  1:16     ` David Bremner
2012-11-25  4:57 ` [PATCH 2/6] lib: Separate list of all messages from top-level messages Austin Clements
2012-11-25  4:57 ` [PATCH 3/6] lib: Eliminate _notmuch_message_list_append Austin Clements
2012-11-25  4:57 ` [PATCH 4/6] lib: Add an iterator over all messages in a thread Austin Clements
2012-11-25  4:57 ` [PATCH 5/6] python: Add bindings for notmuch_thread_get_messages Austin Clements
2013-05-04 18:51   ` David Bremner
2013-05-05 17:00   ` David Bremner
2012-11-25  4:57 ` [PATCH 6/6] ruby: " Austin Clements
2012-11-26 16:23   ` Ali Polatel [this message]
2012-11-25 14:31 ` [PATCH 0/6] API for iterating over all messages in a thread Mark Walters
2012-11-25 21:20   ` Austin Clements
2012-11-26 17:19     ` Tomi Ollila
2012-11-26 17:35       ` Austin Clements

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=20121126162316.GB5669@hayalet \
    --to=polatel@gmail.com \
    --cc=amdragon@MIT.EDU \
    --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).