--- /dev/null
+Return-Path: <markwalters1009@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 D22A6431FD7\r
+ for <notmuch@notmuchmail.org>; Sat, 11 May 2013 13:15:57 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+ tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+ 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 I6Zb-hQTOHa6 for <notmuch@notmuchmail.org>;\r
+ Sat, 11 May 2013 13:15:52 -0700 (PDT)\r
+Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com\r
+ [209.85.212.172]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 30B25431FBC\r
+ for <notmuch@notmuchmail.org>; Sat, 11 May 2013 13:15:52 -0700 (PDT)\r
+Received: by mail-wi0-f172.google.com with SMTP id hm14so1676730wib.11\r
+ for <notmuch@notmuchmail.org>; Sat, 11 May 2013 13:15:51 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to\r
+ :references; bh=Omh3ywOPV++u7FR9fGbjMYdYcyRLCPf0rCy+EaConHE=;\r
+ b=QtBfaeTMg6Jf/GaJqkMZwyh+OogKOtAa2dLeUicFPZOXk2iZk/IKOfEvDnrfABpdp3\r
+ EOBRTojMie/sDYMcwVlnfiviDZTJaC2pD9zpnrkwGo/NES2POglQ/1EBqHanzxUOr53d\r
+ VtpxtCAkcVC9lIMi/jrB5yJHv5hdBBrHpQIDfFn0zcn7TYLwlJAzzr0do+u7WHyQ2Cla\r
+ feIgWWdcCMLLkwDk076w4G452NAYVADiNQ6GEJiULOWa7z+HFJL15Gp4J90ZieW15ytV\r
+ nN44E7889CFmmhiROx0E8JUht/hedc7xtmdm6Vs00Fwo3oSfYAfDE4Wgkk2fx9e4tYmM\r
+ ersw==\r
+X-Received: by 10.194.158.37 with SMTP id wr5mr31340241wjb.23.1368303351131;\r
+ Sat, 11 May 2013 13:15:51 -0700 (PDT)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+ by mx.google.com with ESMTPSA id e8sm5791628wic.5.2013.05.11.13.15.50\r
+ for <multiple recipients>\r
+ (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+ Sat, 11 May 2013 13:15:50 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/3] cli: show: separate out the printing of recipient headers\r
+Date: Sat, 11 May 2013 21:15:42 +0100\r
+Message-Id: <1368303344-13713-2-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1368303344-13713-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1368303344-13713-1-git-send-email-markwalters1009@gmail.com>\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: Sat, 11 May 2013 20:15:58 -0000\r
+\r
+This splits out the sprinter printing of recipient headers so that\r
+notmuch-reply can call it directly. This will be used when reply\r
+outputs header for reply-all and reply-to-sender.\r
+---\r
+ notmuch-client.h | 3 +++\r
+ notmuch-show.c | 35 +++++++++++++++++++++--------------\r
+ 2 files changed, 24 insertions(+), 14 deletions(-)\r
+\r
+diff --git a/notmuch-client.h b/notmuch-client.h\r
+index 45749a6..d55d4c0 100644\r
+--- a/notmuch-client.h\r
++++ b/notmuch-client.h\r
+@@ -223,6 +223,9 @@ void\r
+ format_headers_sprinter (struct sprinter *sp, GMimeMessage *message,\r
+ notmuch_bool_t reply);\r
+ \r
++void\r
++format_headers_recipients_sprinter (struct sprinter *sp, GMimeMessage *message);\r
++\r
+ typedef enum {\r
+ NOTMUCH_SHOW_TEXT_PART_REPLY = 1 << 0,\r
+ } notmuch_show_text_part_flags;\r
+diff --git a/notmuch-show.c b/notmuch-show.c\r
+index 62178f7..8b9ab61 100644\r
+--- a/notmuch-show.c\r
++++ b/notmuch-show.c\r
+@@ -213,23 +213,10 @@ _is_from_line (const char *line)\r
+ }\r
+ \r
+ void\r
+-format_headers_sprinter (sprinter_t *sp, GMimeMessage *message,\r
+- notmuch_bool_t reply)\r
++format_headers_recipients_sprinter (sprinter_t *sp, GMimeMessage *message)\r
+ {\r
+- /* Any changes to the JSON or S-Expression format should be\r
+- * reflected in the file devel/schemata. */\r
+-\r
+ InternetAddressList *recipients;\r
+ const char *recipients_string;\r
+- const char *reply_to_string;\r
+-\r
+- sp->begin_map (sp);\r
+-\r
+- sp->map_key (sp, "Subject");\r
+- sp->string (sp, g_mime_message_get_subject (message));\r
+-\r
+- sp->map_key (sp, "From");\r
+- sp->string (sp, g_mime_message_get_sender (message));\r
+ \r
+ recipients = g_mime_message_get_recipients (message, GMIME_RECIPIENT_TYPE_TO);\r
+ recipients_string = internet_address_list_to_string (recipients, 0);\r
+@@ -251,6 +238,26 @@ format_headers_sprinter (sprinter_t *sp, GMimeMessage *message,\r
+ sp->map_key (sp, "Bcc");\r
+ sp->string (sp, recipients_string);\r
+ }\r
++}\r
++\r
++void\r
++format_headers_sprinter (sprinter_t *sp, GMimeMessage *message,\r
++ notmuch_bool_t reply)\r
++{\r
++ /* Any changes to the JSON or S-Expression format should be\r
++ * reflected in the file devel/schemata. */\r
++\r
++ const char *reply_to_string;\r
++\r
++ sp->begin_map (sp);\r
++\r
++ sp->map_key (sp, "Subject");\r
++ sp->string (sp, g_mime_message_get_subject (message));\r
++\r
++ sp->map_key (sp, "From");\r
++ sp->string (sp, g_mime_message_get_sender (message));\r
++\r
++ format_headers_recipients_sprinter (sp, message);\r
+ \r
+ reply_to_string = g_mime_message_get_reply_to (message);\r
+ if (reply_to_string) {\r
+-- \r
+1.7.9.1\r
+\r