Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / f6 / 59684433ac6c742395c059f2e457bcc8155b1d
1 Return-Path: <jani@nikula.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5  by arlo.cworth.org (Postfix) with ESMTP id 6D5466DE39D0\r
6  for <notmuch@notmuchmail.org>; Sat, 13 Aug 2016 04:39:28 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
9 X-Spam-Flag: NO\r
10 X-Spam-Score: -0.573\r
11 X-Spam-Level: \r
12 X-Spam-Status: No, score=-0.573 tagged_above=-999 required=5 tests=[AWL=0.147,\r
13   DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7,\r
14  RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled\r
15 Received: from arlo.cworth.org ([127.0.0.1])\r
16  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
17  with ESMTP id HasmXwsrR4Nj for <notmuch@notmuchmail.org>;\r
18  Sat, 13 Aug 2016 04:39:20 -0700 (PDT)\r
19 Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com\r
20  [74.125.82.67]) by arlo.cworth.org (Postfix) with ESMTPS id 6C0D36DE38CC for\r
21  <notmuch@notmuchmail.org>; Sat, 13 Aug 2016 04:39:09 -0700 (PDT)\r
22 Received: by mail-wm0-f67.google.com with SMTP id i5so2016567wmg.2\r
23  for <notmuch@notmuchmail.org>; Sat, 13 Aug 2016 04:39:09 -0700 (PDT)\r
24 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25  d=nikula-org.20150623.gappssmtp.com; s=20150623;\r
26  h=from:to:cc:subject:date:message-id:in-reply-to:references\r
27  :in-reply-to:references;\r
28  bh=mz2de6cLXojScvGRGmcz0RhTYF2mOcaPT9Nzasi4nKQ=;\r
29  b=A9EvdMo1gWTnr9njPkRGF3tNzmC3/1oY9b6TEpsPHuRheWB1XiOflkgyP5o9qRmO/C\r
30  sE9HIouW87BErHX6R5f6xncLEYSmTme6O9tx40PSyUzc8PvKpe1cWemtHxFltaRmh1pt\r
31  dkSFPaef22O4ptcf8QY20mBUMS+yXL464p7nRv3FHoLB7+pRifecQoAt5B0xiCJrty3+\r
32  IjAxuhZ/0uahiV8lBzI4uL93Yx12POixQtchNBiro9ecB7zkRSx62whajv0VVCMTKWEh\r
33  AUy+iEg66oiYkzhpqRXEmYevp2E+ZLRYwJM1IzGPZQ0fziSGq0EZhIiRqZrGFavYXX3j\r
34  3++g==\r
35 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
36  d=1e100.net; s=20130820;\r
37  h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r
38  :references:in-reply-to:references;\r
39  bh=mz2de6cLXojScvGRGmcz0RhTYF2mOcaPT9Nzasi4nKQ=;\r
40  b=Ylyhs/FN+gvw7sCXiVvemC+c5wyuGhdgWlJ/Vp6GCP7W+tQo8MaRp/K4jgAM4+dbWp\r
41  aypHN2Gu8/RHxgB/FgS6WYGlcIm50rnoh46KjZO7c6mRIBtBqfy3VeVdMCX4wspJtHst\r
42  pLOomKzHEqNXELTv5idZ+lMsZ9PXv8NoYV4btBTNyvIHP9nuYHYFWpC1X76tPBvSXEf6\r
43  7+88FAtb2HVr9JVVfWjZ7g6VcuK4udadLpVRs/x7L9GFOd0isnNcZ7FmC7nmgeghU4nc\r
44  gV8RObrs0z0e1H3HIMdzD0y+PbEkLgQ8l8Xq3DD3PpeHWG4qm8419wF6AUFZ8N7SOhsr\r
45  b4Uw==\r
46 X-Gm-Message-State:\r
47  AEkoouvfRT/ATr5D4p2GC+9c0c5VDSo4Iyj2Xnt+5MtktSZ4UGDqjEAgtTLE6XMn1JwUkQ==\r
48 X-Received: by 10.28.134.203 with SMTP id i194mr3599877wmd.22.1471088348099;\r
49  Sat, 13 Aug 2016 04:39:08 -0700 (PDT)\r
50 Received: from localhost (mobile-access-bcee63-250.dhcp.inet.fi.\r
51  [188.238.99.250])\r
52  by smtp.gmail.com with ESMTPSA id m62sm6757895wmm.24.2016.08.13.04.39.07\r
53  (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
54  Sat, 13 Aug 2016 04:39:07 -0700 (PDT)\r
55 From: Jani Nikula <jani@nikula.org>\r
56 To: notmuch@notmuchmail.org\r
57 Cc: Daniel Kahn Gillmor <dkg@fifthhorseman.net>,\r
58         jani@nikula.org\r
59 Subject: [PATCH v2 04/14] cli/reply: unify reply format functions\r
60 Date: Sat, 13 Aug 2016 14:37:28 +0300\r
61 Message-Id:\r
62  <bcf94cd7a49879a9d168f7b8b0a9c77c41335237.1471088022.git.jani@nikula.org>\r
63 X-Mailer: git-send-email 2.1.4\r
64 In-Reply-To: <cover.1471088022.git.jani@nikula.org>\r
65 References: <cover.1471088022.git.jani@nikula.org>\r
66 In-Reply-To: <cover.1471088022.git.jani@nikula.org>\r
67 References: <cover.1471088022.git.jani@nikula.org>\r
68 X-BeenThere: notmuch@notmuchmail.org\r
69 X-Mailman-Version: 2.1.20\r
70 Precedence: list\r
71 List-Id: "Use and development of the notmuch mail system."\r
72  <notmuch.notmuchmail.org>\r
73 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
74  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
75 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
76 List-Post: <mailto:notmuch@notmuchmail.org>\r
77 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
78 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
79  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
80 X-List-Received-Date: Sat, 13 Aug 2016 11:39:28 -0000\r
81 \r
82 Prepare for further future unification by making the code similar. The\r
83 only functional change is that errors in mime_node_open() also break\r
84 execution in default reply format.\r
85 ---\r
86  notmuch-reply.c | 18 ++++++++++--------\r
87  1 file changed, 10 insertions(+), 8 deletions(-)\r
88 \r
89 diff --git a/notmuch-reply.c b/notmuch-reply.c\r
90 index 5adbab624ad7..4b97ffa4f096 100644\r
91 --- a/notmuch-reply.c\r
92 +++ b/notmuch-reply.c\r
93 @@ -604,20 +604,20 @@ notmuch_reply_format_default(void *ctx,\r
94                              unused (sprinter_t *sp))\r
95  {\r
96      GMimeMessage *reply;\r
97 -    mime_node_t *root;\r
98 +    mime_node_t *node;\r
99 +\r
100 +    if (mime_node_open (ctx, message, &params->crypto, &node))\r
101 +       return 1;\r
102  \r
103      reply = create_reply_message (ctx, config, message, reply_all);\r
104      if (!reply)\r
105         return 1;\r
106  \r
107      show_reply_headers (reply);\r
108 +    format_part_reply (node);\r
109  \r
110      g_object_unref (G_OBJECT (reply));\r
111 -\r
112 -    if (mime_node_open (ctx, message, &params->crypto, &root) == NOTMUCH_STATUS_SUCCESS) {\r
113 -       format_part_reply (root);\r
114 -       talloc_free (root);\r
115 -    }\r
116 +    talloc_free (node);\r
117  \r
118      return 0;\r
119  }\r
120 @@ -633,7 +633,7 @@ notmuch_reply_format_sprinter(void *ctx,\r
121      GMimeMessage *reply;\r
122      mime_node_t *node;\r
123  \r
124 -    if (mime_node_open (ctx, message, &params->crypto, &node) != NOTMUCH_STATUS_SUCCESS)\r
125 +    if (mime_node_open (ctx, message, &params->crypto, &node))\r
126         return 1;\r
127  \r
128      reply = create_reply_message (ctx, config, message, reply_all);\r
129 @@ -645,7 +645,6 @@ notmuch_reply_format_sprinter(void *ctx,\r
130      /* The headers of the reply message we've created */\r
131      sp->map_key (sp, "reply-headers");\r
132      format_headers_sprinter (sp, reply, TRUE);\r
133 -    g_object_unref (G_OBJECT (reply));\r
134  \r
135      /* Start the original */\r
136      sp->map_key (sp, "original");\r
137 @@ -654,6 +653,9 @@ notmuch_reply_format_sprinter(void *ctx,\r
138      /* End */\r
139      sp->end (sp);\r
140  \r
141 +    g_object_unref (G_OBJECT (reply));\r
142 +    talloc_free (node);\r
143 +\r
144      return 0;\r
145  }\r
146  \r
147 -- \r
148 2.1.4\r
149 \r