Re: [PATCH 0/4] Allow specifying alternate names for addresses in other_email
[notmuch-archives.git] / a0 / 69ec2d12dd55a16bc3fd4f37e6262290c2a349
1 Return-Path: <markwalters1009@gmail.com>\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 olra.theworths.org (Postfix) with ESMTP id 51EEA431FAE\r
6         for <notmuch@notmuchmail.org>; Sat, 30 Jun 2012 00:24:02 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.201\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
14         RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id qCWaC9DAEtfE for <notmuch@notmuchmail.org>;\r
18         Sat, 30 Jun 2012 00:24:01 -0700 (PDT)\r
19 Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com\r
20         [209.85.212.169]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
21         (No client certificate requested)\r
22         by olra.theworths.org (Postfix) with ESMTPS id A618B431FAF\r
23         for <notmuch@notmuchmail.org>; Sat, 30 Jun 2012 00:24:01 -0700 (PDT)\r
24 Received: by wibhm2 with SMTP id hm2so1501843wib.2\r
25         for <notmuch@notmuchmail.org>; Sat, 30 Jun 2012 00:23:59 -0700 (PDT)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
27         h=from:to:cc:subject:date:message-id:x-mailer;\r
28         bh=bj9auI4c99c2jjXN2KghHX5PhZ1XJl/5exjRJttGWdI=;\r
29         b=OjVeteWabUmHFHiaMCR2E9f+5iqXFI+dgy2sCmfpu48Zjb/2SIb/ZY+ksUj/CguEg3\r
30         pxdf4A/KsBCEZjFv181dR3lLKtd8tx7Dz5aj4V0SxlXOdKA6X5CSpN030I2ajmKuQcoK\r
31         ne/0PcvsZL7iIcqUzV4v2u/+eI+7P0kKxk3ei1LnDf3l03PoOlZqJYQz6LIGw20NYFGX\r
32         qHbpvgfcjPDn6ZFcNxHvXzwk/Qis89QfVGRdPhLCRhKwdIc82gxdBM5woAg0XmhcJ4yI\r
33         UkzIZ/dezwtpxtVlcRsM/il7bLJUAzGQUQEBYiJ/4ZJW9alSzuletDCWCQ/ApskXN3RI\r
34         2TRg==\r
35 Received: by 10.180.105.135 with SMTP id gm7mr9919542wib.10.1341041039017;\r
36         Sat, 30 Jun 2012 00:23:59 -0700 (PDT)\r
37 Received: from localhost (94-192-233-223.zone6.bethere.co.uk.\r
38  [94.192.233.223])      by mx.google.com with ESMTPS id\r
39  eu4sm10324184wib.2.2012.06.30.00.23.56 (version=TLSv1/SSLv3 cipher=OTHER);\r
40         Sat, 30 Jun 2012 00:23:57 -0700 (PDT)\r
41 From: Mark Walters <markwalters1009@gmail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [PATCH] cli: notmuch-show with framing newlines between threads in\r
44         JSON.\r
45 Date: Sat, 30 Jun 2012 08:23:44 +0100\r
46 Message-Id: <1341041024-5342-1-git-send-email-markwalters1009@gmail.com>\r
47 X-Mailer: git-send-email 1.7.9.1\r
48 X-BeenThere: notmuch@notmuchmail.org\r
49 X-Mailman-Version: 2.1.13\r
50 Precedence: list\r
51 List-Id: "Use and development of the notmuch mail system."\r
52         <notmuch.notmuchmail.org>\r
53 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
55 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
56 List-Post: <mailto:notmuch@notmuchmail.org>\r
57 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
58 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
59         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
60 X-List-Received-Date: Sat, 30 Jun 2012 07:24:02 -0000\r
61 \r
62 Add newlines between complete threads to make asynchronous parsing\r
63 of the JSON easier.\r
64 ---\r
65 \r
66 notmuch-pick uses the JSON output of notmuch show but, in many cases,\r
67 for many threads. This can take quite a long time when displaying a\r
68 large number of messages (say 20 seconds for the 10,000 messages in\r
69 the notmuch archive). Thus it is desirable to display results\r
70 incrementally in the same way that search currently does.\r
71 \r
72 To make this easier this patch adds newlines between each toplevel\r
73 thread. So the ouput becomes\r
74 \r
75 [\r
76 thread1\r
77 , thread2\r
78 , thread3\r
79 ...\r
80 , last_thread\r
81 ]\r
82 \r
83 Thus the parser can easily tell if it has enough data to do some more\r
84 parsing.\r
85 \r
86 Obviously, this changes the JSON output. This should not break any\r
87 consumer as the JSON parsers should not mind. However, it does break\r
88 several tests. Obviously, I will fix these but I wanted to check if\r
89 people were basically happy with the change first.\r
90 \r
91 Also, should devel/schemata be updated? It seems a little unclear as\r
92 this is not really a "JSON" change as the JSON does not care about the\r
93 newlines.\r
94 \r
95 Best wishes\r
96 \r
97 Mark\r
98 \r
99 \r
100  notmuch-show.c |    5 +++++\r
101  1 files changed, 5 insertions(+), 0 deletions(-)\r
102 \r
103 diff --git a/notmuch-show.c b/notmuch-show.c\r
104 index 195e318..4a1d699 100644\r
105 --- a/notmuch-show.c\r
106 +++ b/notmuch-show.c\r
107 @@ -942,6 +942,8 @@ do_show (void *ctx,\r
108  \r
109      if (format->message_set_start)\r
110         fputs (format->message_set_start, stdout);\r
111 +    if (format == &format_json)\r
112 +       fputs ("\n", stdout);\r
113  \r
114      for (threads = notmuch_query_search_threads (query);\r
115          notmuch_threads_valid (threads);\r
116 @@ -963,6 +965,9 @@ do_show (void *ctx,\r
117         if (status && !res)\r
118             res = status;\r
119  \r
120 +       if (format == &format_json)\r
121 +           fputs ("\n", stdout);\r
122 +\r
123         notmuch_thread_destroy (thread);\r
124  \r
125      }\r
126 -- \r
127 1.7.9.1\r
128 \r