From b4a6e6471d1f455c5670f2f1c0a061020e5c3ebe Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Sun, 29 Jul 2012 00:29:13 +2000 Subject: [PATCH] [PATCH v2 12/13] show: Convert do_show to use sprinter --- 04/de2c99f75e57be5e21229500632db5b91b73f4 | 119 ++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 04/de2c99f75e57be5e21229500632db5b91b73f4 diff --git a/04/de2c99f75e57be5e21229500632db5b91b73f4 b/04/de2c99f75e57be5e21229500632db5b91b73f4 new file mode 100644 index 000000000..55fbd951c --- /dev/null +++ b/04/de2c99f75e57be5e21229500632db5b91b73f4 @@ -0,0 +1,119 @@ +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 AC4D9431FB6 + for ; Fri, 27 Jul 2012 21:29:44 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 FtsvRFwAv8bA for ; + Fri, 27 Jul 2012 21:29:44 -0700 (PDT) +Received: from dmz-mailsec-scanner-8.mit.edu (DMZ-MAILSEC-SCANNER-8.MIT.EDU + [18.7.68.37]) + by olra.theworths.org (Postfix) with ESMTP id 9015C431FCB + for ; Fri, 27 Jul 2012 21:29:28 -0700 (PDT) +X-AuditID: 12074425-b7f9b6d0000008c4-9d-50136aa83a6d +Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) + by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP + id 76.70.02244.8AA63105; Sat, 28 Jul 2012 00:29:28 -0400 (EDT) +Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) + by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q6S4TREt002962; + Sat, 28 Jul 2012 00:29:27 -0400 +Received: from drake.dyndns.org + (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com + [209.6.116.242]) (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q6S4TL6o027363 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Sat, 28 Jul 2012 00:29:22 -0400 (EDT) +Received: from amthrax by drake.dyndns.org with local (Exim 4.77) + (envelope-from ) + id 1SuyeW-0002XG-Uj; Sat, 28 Jul 2012 00:29:20 -0400 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH v2 12/13] show: Convert do_show to use sprinter +Date: Sat, 28 Jul 2012 00:29:13 -0400 +Message-Id: <1343449754-9010-13-git-send-email-amdragon@mit.edu> +X-Mailer: git-send-email 1.7.10 +In-Reply-To: <1343449754-9010-1-git-send-email-amdragon@mit.edu> +References: <1343449754-9010-1-git-send-email-amdragon@mit.edu> +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFjrLIsWRmVeSWpSXmKPExsUixG6norsiSzjAoGUBi8XehnZGi9VzeSyu + 35zJbPFm5TxWBxaPnbPusnss3rSfzePw14UsHs9W3WIOYInisklJzcksSy3St0vgyujZfYGt + 4Bdnxe2ZX9gaGB+xdzFyckgImEi8vvqCFcIWk7hwbz1bFyMXh5DAPkaJZ9MuQjkbGCVWtLaC + dQgJPGKSWD9dDiIxl1HiwftWNpAEm4CGxLb9yxlBbBEBaYmdd2cDjeXgYBbIk3i8VgLEFBaw + lzjUUg1SwSKgKjH3xkc2kDCvgIPE/iepEDfISzy93wc2kBMovPnlB2aIrfYSuydvYJ3AyL+A + kWEVo2xKbpVubmJmTnFqsm5xcmJeXmqRroVebmaJXmpK6SZGcKi5qO5gnHBI6RCjAAejEg/v + qStCAUKsiWXFlbmHGCU5mJREeaPChQOE+JLyUyozEosz4otKc1KLDzFKcDArifDuFATK8aYk + VlalFuXDpKQ5WJTEeW+k3PQXEkhPLEnNTk0tSC2CycpwcChJ8G7PBGoULEpNT61Iy8wpQUgz + cXCCDOcBGr4GpIa3uCAxtzgzHSJ/ilFRSpx3EkhCACSRUZoH1wtLBa8YxYFeEea9BlLFA0wj + cN2vgAYzAQ22iBYCGVySiJCSamAUPf7UU1WwT8NmxV7jPS8Trx7f8GFXSWeZm5tfwS+T6tbv + rdHL5nrYrT/htYRVWnPDZCOb2fNWHRS7qhl2c8rS1fZrpt/j2dT8WLUypo7tXlDVtSOvhRKr + Yg6Y1K6e5m34U2S7rmWTrrbe9r9u9/+aRd3POfrGZLqkkWTgnwbtZEaZWW/r6qyVWIozEg21 + mIuKEwF7z+L64AIAAA== +Cc: tomi.ollila@iki.fi +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: Sat, 28 Jul 2012 04:29:45 -0000 + +--- + notmuch-show.c | 11 ++--------- + 1 file changed, 2 insertions(+), 9 deletions(-) + +diff --git a/notmuch-show.c b/notmuch-show.c +index ec3e861..89bf2e7 100644 +--- a/notmuch-show.c ++++ b/notmuch-show.c +@@ -961,11 +961,9 @@ do_show (void *ctx, + notmuch_threads_t *threads; + notmuch_thread_t *thread; + notmuch_messages_t *messages; +- int first_toplevel = 1; + notmuch_status_t status, res = NOTMUCH_STATUS_SUCCESS; + +- if (format->message_set_start) +- fputs (format->message_set_start, stdout); ++ sp->begin_list (sp); + + for (threads = notmuch_query_search_threads (query); + notmuch_threads_valid (threads); +@@ -979,10 +977,6 @@ do_show (void *ctx, + INTERNAL_ERROR ("Thread %s has no toplevel messages.\n", + notmuch_thread_get_thread_id (thread)); + +- if (!first_toplevel && format->message_set_sep) +- fputs (format->message_set_sep, stdout); +- first_toplevel = 0; +- + status = show_messages (ctx, format, sp, messages, 0, params); + if (status && !res) + res = status; +@@ -991,8 +985,7 @@ do_show (void *ctx, + + } + +- if (format->message_set_end) +- fputs (format->message_set_end, stdout); ++ sp->end (sp); + + return res != NOTMUCH_STATUS_SUCCESS; + } +-- +1.7.10 + -- 2.26.2