From: Austin Clements <amdragon@MIT.EDU>
To: notmuch@notmuchmail.org
Cc: tomi.ollila@iki.fi
Subject: [PATCH v3 05/13] reply: Create a JSON sprinter
Date: Thu, 2 Aug 2012 21:14:51 -0400 [thread overview]
Message-ID: <1343956499-14543-6-git-send-email-amdragon@mit.edu> (raw)
In-Reply-To: <1343956499-14543-1-git-send-email-amdragon@mit.edu>
---
notmuch-reply.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/notmuch-reply.c b/notmuch-reply.c
index de21f3b..e42ba79 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -22,6 +22,7 @@
#include "notmuch-client.h"
#include "gmime-filter-headers.h"
+#include "sprinter.h"
static void
show_reply_headers (GMimeMessage *message)
@@ -596,6 +597,7 @@ notmuch_reply_format_json(void *ctx,
notmuch_messages_t *messages;
notmuch_message_t *message;
mime_node_t *node;
+ sprinter_t *sp;
if (notmuch_query_count_messages (query) != 1) {
fprintf (stderr, "Error: search term did not match precisely one message.\n");
@@ -611,6 +613,8 @@ notmuch_reply_format_json(void *ctx,
if (!reply)
return 1;
+ sp = sprinter_json_create (ctx, stdout);
+
/* The headers of the reply message we've created */
printf ("{\"reply-headers\": ");
format_headers_json (ctx, reply, TRUE);
--
1.7.10
next prev parent reply other threads:[~2012-08-03 1:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-03 1:14 [PATCH v3 00/13] Convert notmuch show to use structure printers Austin Clements
2012-08-03 1:14 ` [PATCH v3 01/13] test: Uniformly canonicalize actual and expected JSON Austin Clements
2012-08-03 1:14 ` [PATCH v3 02/13] test: Remove unnecessary JSON canonicalization Austin Clements
2012-08-03 1:14 ` [PATCH v3 03/13] sprinter: Add a string_len method Austin Clements
2012-08-03 1:14 ` [PATCH v3 04/13] show: Associate an sprinter with each format Austin Clements
2012-08-03 1:14 ` Austin Clements [this message]
2012-08-03 1:14 ` [PATCH v3 06/13] show: Feed the sprinter down to part formatters Austin Clements
2012-08-03 1:14 ` [PATCH v3 07/13] show: Convert format_headers_json to use sprinter Austin Clements
2012-08-03 1:14 ` [PATCH v3 08/13] show: Convert format_part_sigstatus_json " Austin Clements
2012-08-03 1:14 ` [PATCH v3 09/13] show: Convert non-envelope format_part_json " Austin Clements
2012-08-03 1:14 ` [PATCH v3 10/13] show: Convert envelope " Austin Clements
2012-08-03 1:14 ` [PATCH v3 11/13] show: Convert show_message " Austin Clements
2012-08-03 1:14 ` [PATCH v3 12/13] show: Convert do_show " Austin Clements
2012-08-03 1:14 ` [PATCH v3 13/13] show: Remove now unused fields from notmuch_show_format Austin Clements
2012-08-03 9:35 ` [PATCH v3 00/13] Convert notmuch show to use structure printers Tomi Ollila
2012-08-03 23:48 ` David Bremner
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=1343956499-14543-6-git-send-email-amdragon@mit.edu \
--to=amdragon@mit.edu \
--cc=notmuch@notmuchmail.org \
--cc=tomi.ollila@iki.fi \
/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).