Re: [PATCH 6/6] ruby: Add bindings for notmuch_thread_get_messages
authorAli Polatel <polatel@gmail.com>
Mon, 26 Nov 2012 16:23:16 +0000 (18:23 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:51:02 +0000 (09:51 -0800)
1e/2234949b129831318c3f4aeefe6915bf6b40e1 [new file with mode: 0644]

diff --git a/1e/2234949b129831318c3f4aeefe6915bf6b40e1 b/1e/2234949b129831318c3f4aeefe6915bf6b40e1
new file mode 100644 (file)
index 0000000..6fe8a0d
--- /dev/null
@@ -0,0 +1,170 @@
+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 46D98431FAF\r
+       for <notmuch@notmuchmail.org>; Mon, 26 Nov 2012 08:23:05 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, 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 JCBtJORwRxJV for <notmuch@notmuchmail.org>;\r
+       Mon, 26 Nov 2012 08:23:04 -0800 (PST)\r
+Received: from mail-ea0-f181.google.com (mail-ea0-f181.google.com\r
+       [209.85.215.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 8ED41431FAE\r
+       for <notmuch@notmuchmail.org>; Mon, 26 Nov 2012 08:23:04 -0800 (PST)\r
+Received: by mail-ea0-f181.google.com with SMTP id k14so3538249eaa.26\r
+       for <notmuch@notmuchmail.org>; Mon, 26 Nov 2012 08:23:03 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=date:from:to:cc:subject:message-id:mail-followup-to:references\r
+       :mime-version:content-type:content-disposition:in-reply-to\r
+       :organization:user-agent;\r
+       bh=WRDaEOn0RbNdxEl9RvnCxl+1ggQSwz5b1SR5HTTJ7Hw=;\r
+       b=rmb2rjgk6gDoWAW1KMNxZpd2ewyJgQzz2LTSoj2H/ZXrrj49UdS9bDVD+kMlFrnSv3\r
+       WcvsG4atv68Ber/1TT3wWHX15O+nV48/18msiddsks05yxy6aROf9j7V+y8MsuQ5P7XO\r
+       LM9kgchHg+Zgt3kDxBwDsG8bKNK6yKZ3n8H2SWapfuDIJZ8r6LbmhrUFR072hDyCuFu/\r
+       SbP3h+cAv4Ataddl1AdtnRdVN4i7bdY7AqXzNOId3NbokZ8eJ4DbIrq64aA2BS5m/ov9\r
+       h0IagjelYOhH3FzY3cACUaSCS3VepEwRJ6tTzZM8WicT0uy4E2pMBS/7mwzFgZTkK7HD\r
+       HvDA==\r
+Received: by 10.14.205.65 with SMTP id i41mr47519406eeo.2.1353946983405;\r
+       Mon, 26 Nov 2012 08:23:03 -0800 (PST)\r
+Received: from localhost ([88.233.27.222])\r
+       by mx.google.com with ESMTPS id b2sm3544616eep.9.2012.11.26.08.23.01\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Mon, 26 Nov 2012 08:23:01 -0800 (PST)\r
+Date: Mon, 26 Nov 2012 18:23:16 +0200\r
+From: Ali Polatel <polatel@gmail.com>\r
+To: Austin Clements <amdragon@MIT.EDU>\r
+Subject: Re: [PATCH 6/6] ruby: Add bindings for notmuch_thread_get_messages\r
+Message-ID: <20121126162316.GB5669@hayalet>\r
+Mail-Followup-To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org\r
+References: <1353819427-13182-1-git-send-email-amdragon@mit.edu>\r
+       <1353819427-13182-7-git-send-email-amdragon@mit.edu>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; micalg=pgp-sha1;\r
+       protocol="application/pgp-signature"; boundary="LpQ9ahxlCli8rRTG"\r
+Content-Disposition: inline\r
+In-Reply-To: <1353819427-13182-7-git-send-email-amdragon@mit.edu>\r
+Organization: Pink Floyd\r
+User-Agent: Mutt/1.5.21 (2011-07-01)\r
+Cc: 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, 26 Nov 2012 16:23:05 -0000\r
+\r
+\r
+--LpQ9ahxlCli8rRTG\r
+Content-Type: text/plain; charset=us-ascii; format=flowed\r
+Content-Disposition: inline\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+LGTM. Thanks for showing love to the ruby bindings as I was away.\r
+\r
+On Sat, Nov 24, 2012 at 11:57:07PM -0500, Austin Clements wrote:\r
+>---\r
+> bindings/ruby/defs.h   |    3 +++\r
+> bindings/ruby/init.c   |    1 +\r
+> bindings/ruby/thread.c |   20 ++++++++++++++++++++\r
+> 3 files changed, 24 insertions(+)\r
+>\r
+>diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h\r
+>index fe81b3f..5b44585 100644\r
+>--- a/bindings/ruby/defs.h\r
+>+++ b/bindings/ruby/defs.h\r
+>@@ -262,6 +262,9 @@ VALUE\r
+> notmuch_rb_thread_get_toplevel_messages (VALUE self);\r
+>\r
+> VALUE\r
+>+notmuch_rb_thread_get_messages (VALUE self);\r
+>+\r
+>+VALUE\r
+> notmuch_rb_thread_get_matched_messages (VALUE self);\r
+>\r
+> VALUE\r
+>diff --git a/bindings/ruby/init.c b/bindings/ruby/init.c\r
+>index f4931d3..663271d 100644\r
+>--- a/bindings/ruby/init.c\r
+>+++ b/bindings/ruby/init.c\r
+>@@ -306,6 +306,7 @@ Init_notmuch (void)\r
+>     rb_define_method (notmuch_rb_cThread, "thread_id", notmuch_rb_thread_=\r
+get_thread_id, 0); /* in thread.c */\r
+>     rb_define_method (notmuch_rb_cThread, "total_messages", notmuch_rb_th=\r
+read_get_total_messages, 0); /* in thread.c */\r
+>     rb_define_method (notmuch_rb_cThread, "toplevel_messages", notmuch_rb=\r
+_thread_get_toplevel_messages, 0); /* in thread.c */\r
+>+    rb_define_method (notmuch_rb_cThread, "messages", notmuch_rb_thread_g=\r
+et_messages, 0); /* in thread.c */\r
+>     rb_define_method (notmuch_rb_cThread, "matched_messages", notmuch_rb_=\r
+thread_get_matched_messages, 0); /* in thread.c */\r
+>     rb_define_method (notmuch_rb_cThread, "authors", notmuch_rb_thread_ge=\r
+t_authors, 0); /* in thread.c */\r
+>     rb_define_method (notmuch_rb_cThread, "subject", notmuch_rb_thread_ge=\r
+t_subject, 0); /* in thread.c */\r
+>diff --git a/bindings/ruby/thread.c b/bindings/ruby/thread.c\r
+>index efe5aaf..56616d9 100644\r
+>--- a/bindings/ruby/thread.c\r
+>+++ b/bindings/ruby/thread.c\r
+>@@ -92,6 +92,26 @@ notmuch_rb_thread_get_toplevel_messages (VALUE self)\r
+> }\r
+>\r
+> /*\r
+>+ * call-seq: THREAD.messages =3D> MESSAGES\r
+>+ *\r
+>+ * Get a Notmuch::Messages iterator for the all messages in thread.\r
+>+ */\r
+>+VALUE\r
+>+notmuch_rb_thread_get_messages (VALUE self)\r
+>+{\r
+>+    notmuch_messages_t *messages;\r
+>+    notmuch_thread_t *thread;\r
+>+\r
+>+    Data_Get_Notmuch_Thread (self, thread);\r
+>+\r
+>+    messages =3D notmuch_thread_get_messages (thread);\r
+>+    if (!messages)\r
+>+     rb_raise (notmuch_rb_eMemoryError, "Out of memory");\r
+>+\r
+>+    return Data_Wrap_Struct (notmuch_rb_cMessages, NULL, NULL, messages);\r
+>+}\r
+>+\r
+>+/*\r
+>  * call-seq: THREAD.matched_messages =3D> fixnum\r
+>  *\r
+>  * Get the number of messages in thread that matched the search\r
+>--=20\r
+>1.7.10.4\r
+>\r
+>_______________________________________________\r
+>notmuch mailing list\r
+>notmuch@notmuchmail.org\r
+>http://notmuchmail.org/mailman/listinfo/notmuch\r
+\r
+--LpQ9ahxlCli8rRTG\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v2.0.19 (GNU/Linux)\r
+\r
+iEYEARECAAYFAlCzl3QACgkQQU4yORhF8iCwrQCfbbu4SuiAV6UrlY9W57pG5lgP\r
+IBoAoLwV0vDAS8RnHZoZeRz7Sgm+NMAL\r
+=Lq/e\r
+-----END PGP SIGNATURE-----\r
+\r
+--LpQ9ahxlCli8rRTG--\r