--- /dev/null
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id BDF6E6DE091F\r
+ for <notmuch@notmuchmail.org>; Sat, 18 Jun 2016 14:33:18 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.563\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.563 tagged_above=-999 required=5 tests=[AWL=0.157,\r
+ DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7,\r
+ RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id AZgEMTa7VEHQ for <notmuch@notmuchmail.org>;\r
+ Sat, 18 Jun 2016 14:33:11 -0700 (PDT)\r
+Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com\r
+ [74.125.82.68]) by arlo.cworth.org (Postfix) with ESMTPS id A8D9E6DE0231 for\r
+ <notmuch@notmuchmail.org>; Sat, 18 Jun 2016 14:33:03 -0700 (PDT)\r
+Received: by mail-wm0-f68.google.com with SMTP id a66so396352wme.2\r
+ for <notmuch@notmuchmail.org>; Sat, 18 Jun 2016 14:33:03 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=nikula-org.20150623.gappssmtp.com; s=20150623;\r
+ h=from:to:cc:subject:date:message-id:in-reply-to:references\r
+ :in-reply-to:references;\r
+ bh=mz2de6cLXojScvGRGmcz0RhTYF2mOcaPT9Nzasi4nKQ=;\r
+ b=Magt06EtBBNQajN6ARVORMpNbPD+WBAFAsBD9NAY4duKNM5n+GV4NjeDTcm9w7A/0A\r
+ CfF2BUyZuOpRNV39V43nxlXXQSKtEHZ3BC61AglzXJOFCeva9r/kN5E28jxk1OLfB+Rk\r
+ WDVCDmHzPe5BneHwqWHT7zn+NMBnEGYbix+oKQbADI/1X4qWrDOxp0Pt/LxuOCcsZfpT\r
+ aruT+3z+JVSbtX8HkK+P/HgZL8HPZDzqrUM/FJu17zgr4EDSFtw60SZzGr7aXAPnysUt\r
+ aO3BlSiloCoWcLgAsuYjzxLR0R9Vqtq2iJ56Xp9tkApDE5Zs/uOajuyVCyjaV+EY+mDi\r
+ h0bQ==\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r
+ :references:in-reply-to:references;\r
+ bh=mz2de6cLXojScvGRGmcz0RhTYF2mOcaPT9Nzasi4nKQ=;\r
+ b=iez6qS+3pyPkhRJCq3Fjo7fiMoGHFVwOjzktGjFqD5kRWRJkA90vroxNRBQ72xiDIA\r
+ t38gB61VcmcjR6N8o36E4QLoPC3VsCJH+N9I2Px7jcYhwJQUubsuZCpRQ17kEUIZIZRU\r
+ /usvL0Fq96mRTI+zLwEQOOABsCJgQKVgZ/ydH4wsq5fMyQBZ9cbEfZnzRr5KvaVPdYlc\r
+ um+0RCEjhrsDI1Y3Hhz+TPLM4lkCtu67kjJlLGnxYM86Kx81CaPKb9DwF2YFupyAVUEB\r
+ qnYiqn8HOYP5kXEMCreduiQfCQgYKXv57W461irzIj0lYwpEhfmmluHzA/A1nn0Lh2xF\r
+ 1/XQ==\r
+X-Gm-Message-State:\r
+ ALyK8tIR8J75WEW27jw0NuIqZclt1GaKXKZZrsm6s7BPk6fh7NeD7/Kr7pijEZSFI2HWXw==\r
+X-Received: by 10.28.199.205 with SMTP id x196mr4126286wmf.96.1466285582370;\r
+ Sat, 18 Jun 2016 14:33:02 -0700 (PDT)\r
+Received: from localhost (mobile-access-bcee4e-81.dhcp.inet.fi.\r
+ [188.238.78.81])\r
+ by smtp.gmail.com with ESMTPSA id r130sm1676742wmf.20.2016.06.18.14.33.01\r
+ (version=TLSv1/SSLv3 cipher=OTHER);\r
+ Sat, 18 Jun 2016 14:33:01 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Cc: jani@nikula.org,\r
+ Daniel Kahn Gillmor <dkg@fifthhorseman.net>\r
+Subject: [PATCH 3/7] cli/reply: unify reply format functions\r
+Date: Sun, 19 Jun 2016 00:31:29 +0300\r
+Message-Id:\r
+ <bef407ca64fd6340c4d48e5111adcca68a8d7c11.1466284726.git.jani@nikula.org>\r
+X-Mailer: git-send-email 2.1.4\r
+In-Reply-To: <cover.1466284726.git.jani@nikula.org>\r
+References: <cover.1466284726.git.jani@nikula.org>\r
+In-Reply-To: <cover.1466284726.git.jani@nikula.org>\r
+References: <cover.1466284726.git.jani@nikula.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://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: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 18 Jun 2016 21:33:18 -0000\r
+\r
+Prepare for further future unification by making the code similar. The\r
+only functional change is that errors in mime_node_open() also break\r
+execution in default reply format.\r
+---\r
+ notmuch-reply.c | 18 ++++++++++--------\r
+ 1 file changed, 10 insertions(+), 8 deletions(-)\r
+\r
+diff --git a/notmuch-reply.c b/notmuch-reply.c\r
+index 5adbab624ad7..4b97ffa4f096 100644\r
+--- a/notmuch-reply.c\r
++++ b/notmuch-reply.c\r
+@@ -604,20 +604,20 @@ notmuch_reply_format_default(void *ctx,\r
+ unused (sprinter_t *sp))\r
+ {\r
+ GMimeMessage *reply;\r
+- mime_node_t *root;\r
++ mime_node_t *node;\r
++\r
++ if (mime_node_open (ctx, message, ¶ms->crypto, &node))\r
++ return 1;\r
+ \r
+ reply = create_reply_message (ctx, config, message, reply_all);\r
+ if (!reply)\r
+ return 1;\r
+ \r
+ show_reply_headers (reply);\r
++ format_part_reply (node);\r
+ \r
+ g_object_unref (G_OBJECT (reply));\r
+-\r
+- if (mime_node_open (ctx, message, ¶ms->crypto, &root) == NOTMUCH_STATUS_SUCCESS) {\r
+- format_part_reply (root);\r
+- talloc_free (root);\r
+- }\r
++ talloc_free (node);\r
+ \r
+ return 0;\r
+ }\r
+@@ -633,7 +633,7 @@ notmuch_reply_format_sprinter(void *ctx,\r
+ GMimeMessage *reply;\r
+ mime_node_t *node;\r
+ \r
+- if (mime_node_open (ctx, message, ¶ms->crypto, &node) != NOTMUCH_STATUS_SUCCESS)\r
++ if (mime_node_open (ctx, message, ¶ms->crypto, &node))\r
+ return 1;\r
+ \r
+ reply = create_reply_message (ctx, config, message, reply_all);\r
+@@ -645,7 +645,6 @@ notmuch_reply_format_sprinter(void *ctx,\r
+ /* The headers of the reply message we've created */\r
+ sp->map_key (sp, "reply-headers");\r
+ format_headers_sprinter (sp, reply, TRUE);\r
+- g_object_unref (G_OBJECT (reply));\r
+ \r
+ /* Start the original */\r
+ sp->map_key (sp, "original");\r
+@@ -654,6 +653,9 @@ notmuch_reply_format_sprinter(void *ctx,\r
+ /* End */\r
+ sp->end (sp);\r
+ \r
++ g_object_unref (G_OBJECT (reply));\r
++ talloc_free (node);\r
++\r
+ return 0;\r
+ }\r
+ \r
+-- \r
+2.1.4\r
+\r