From 9be5cc0df05ccd7485589b44a1226d290aabaa11 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Tue, 7 Aug 2012 16:07:04 +0300 Subject: [PATCH] Re: [PATCH] reply: Convert JSON format to use sprinter --- a1/422ae65f97dd92862b0b062a40a383dc09c0e7 | 103 ++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 a1/422ae65f97dd92862b0b062a40a383dc09c0e7 diff --git a/a1/422ae65f97dd92862b0b062a40a383dc09c0e7 b/a1/422ae65f97dd92862b0b062a40a383dc09c0e7 new file mode 100644 index 000000000..2f7531420 --- /dev/null +++ b/a1/422ae65f97dd92862b0b062a40a383dc09c0e7 @@ -0,0 +1,103 @@ +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 42606431FD5 + for ; Tue, 7 Aug 2012 06:06:57 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + 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 xnYNP4va3FDX for ; + Tue, 7 Aug 2012 06:06:56 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 6EB50431FAF + for ; Tue, 7 Aug 2012 06:06:56 -0700 (PDT) +Received: by guru.guru-group.fi (Postfix, from userid 501) + id 7ED9E1002A4; Tue, 7 Aug 2012 16:07:04 +0300 (EEST) +From: Tomi Ollila +To: Austin Clements , notmuch@notmuchmail.org +Subject: Re: [PATCH] reply: Convert JSON format to use sprinter +In-Reply-To: <1344344230-9937-1-git-send-email-amdragon@mit.edu> +References: <1344344230-9937-1-git-send-email-amdragon@mit.edu> +User-Agent: Notmuch/0.13.2+128~g07453d8 (http://notmuchmail.org) Emacs/23.1.1 + (x86_64-redhat-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +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: Tue, 07 Aug 2012 13:06:57 -0000 + +On Tue, Aug 07 2012, Austin Clements wrote: + +> Almost all of reply was already being formatted using the sprinter. +> This patch converts the top-level dictionary to use the sprinter +> interface. +> --- + +LGTM. + +Tomi + + +> +> One last sprinter piece that had slipped through the cracks. +> +> notmuch-reply.c | 8 ++++---- +> 1 file changed, 4 insertions(+), 4 deletions(-) +> +> diff --git a/notmuch-reply.c b/notmuch-reply.c +> index fa6665f..e60a264 100644 +> --- a/notmuch-reply.c +> +++ b/notmuch-reply.c +> @@ -614,20 +614,20 @@ notmuch_reply_format_json(void *ctx, +> return 1; +> +> sp = sprinter_json_create (ctx, stdout); +> + sp->begin_map (sp); +> +> /* The headers of the reply message we've created */ +> - printf ("{\"reply-headers\": "); +> + sp->map_key (sp, "reply-headers"); +> format_headers_json (sp, reply, TRUE); +> g_object_unref (G_OBJECT (reply)); +> reply = NULL; +> +> /* Start the original */ +> - printf (", \"original\": "); +> - +> + sp->map_key (sp, "original"); +> format_part_json (ctx, sp, node, TRUE, TRUE); +> +> /* End */ +> - printf ("}\n"); +> + sp->end (sp); +> notmuch_message_destroy (message); +> +> return 0; +> -- +> 1.7.10 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch -- 2.26.2