Re: [PATCH 0/4] Allow specifying alternate names for addresses in other_email
[notmuch-archives.git] / 00 / f6b5c39b1c7efd3001f93f4d36acff8adde4f8
1 Return-Path: <sojkam1@fel.cvut.cz>\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 3D5DE40D171\r
6         for <notmuch@notmuchmail.org>; Mon,  1 Nov 2010 09:16:38 -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: -1.9\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5\r
12         tests=[BAYES_00=-1.9] autolearn=ham\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id ZA76bNce4On9 for <notmuch@notmuchmail.org>;\r
16         Mon,  1 Nov 2010 09:16:26 -0700 (PDT)\r
17 Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
18         by olra.theworths.org (Postfix) with ESMTP id 04D3C40D155\r
19         for <notmuch@notmuchmail.org>; Mon,  1 Nov 2010 09:16:26 -0700 (PDT)\r
20 Received: from localhost (unknown [192.168.200.4])\r
21         by max.feld.cvut.cz (Postfix) with ESMTP id 93AEF19F32EE;\r
22         Mon,  1 Nov 2010 17:16:24 +0100 (CET)\r
23 X-Virus-Scanned: IMAP AMAVIS\r
24 Received: from max.feld.cvut.cz ([192.168.200.1])\r
25         by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new,\r
26         port 10044)\r
27         with ESMTP id VwsSWUm1bZPB; Mon,  1 Nov 2010 17:16:23 +0100 (CET)\r
28 Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
29         by max.feld.cvut.cz (Postfix) with ESMTP id F244D19F32F2;\r
30         Mon,  1 Nov 2010 17:16:22 +0100 (CET)\r
31 Received: from steelpick.2x.cz (pc-dolezilkova.felk.cvut.cz [147.32.86.26])\r
32         (Authenticated sender: sojkam1)\r
33         by imap.feld.cvut.cz (Postfix) with ESMTPSA id E791815C082;\r
34         Mon,  1 Nov 2010 17:16:22 +0100 (CET)\r
35 Received: from wsh by steelpick.2x.cz with local (Exim 4.72)\r
36         (envelope-from <sojkam1@fel.cvut.cz>)\r
37         id 1PCx3V-000416-U6; Mon, 01 Nov 2010 17:16:22 +0100\r
38 From: Michal Sojka <sojkam1@fel.cvut.cz>\r
39 To: notmuch@notmuchmail.org\r
40 Subject: [PATCH 2/2] Print nothing when search result is empty\r
41 Date: Mon,  1 Nov 2010 17:15:40 +0100\r
42 Message-Id: <1288628140-15410-2-git-send-email-sojkam1@fel.cvut.cz>\r
43 X-Mailer: git-send-email 1.7.2.3\r
44 In-Reply-To: <1288628140-15410-1-git-send-email-sojkam1@fel.cvut.cz>\r
45 References: <1288628140-15410-1-git-send-email-sojkam1@fel.cvut.cz>\r
46 X-BeenThere: notmuch@notmuchmail.org\r
47 X-Mailman-Version: 2.1.13\r
48 Precedence: list\r
49 List-Id: "Use and development of the notmuch mail system."\r
50         <notmuch.notmuchmail.org>\r
51 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
53 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
54 List-Post: <mailto:notmuch@notmuchmail.org>\r
55 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
56 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
57         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
58 X-List-Received-Date: Mon, 01 Nov 2010 16:16:38 -0000\r
59 \r
60 This change affects both text and json formats. Now, text format\r
61 behaves as before commit 6dcb7592, but json format is changed.\r
62 Earlier, the empty search returned '[]', now it returns ''. The emacs\r
63 interface seems not to be affected by this change.\r
64 ---\r
65  notmuch-search.c |   18 ++++++++++++------\r
66  1 files changed, 12 insertions(+), 6 deletions(-)\r
67 \r
68 diff --git a/notmuch-search.c b/notmuch-search.c\r
69 index 5907c2e..bb989da 100644\r
70 --- a/notmuch-search.c\r
71 +++ b/notmuch-search.c\r
72 @@ -189,7 +189,9 @@ do_search_threads (const void *ctx,\r
73      {\r
74         int first_tag = 1;\r
75  \r
76 -       if (! first_thread)\r
77 +       if (first_thread)\r
78 +           fputs (format->results_start, stdout);\r
79 +       else\r
80             fputs (format->item_sep, stdout);\r
81  \r
82         thread = notmuch_threads_get (threads);\r
83 @@ -235,6 +237,9 @@ do_search_threads (const void *ctx,\r
84         notmuch_thread_destroy (thread);\r
85      }\r
86  \r
87 +    if (! first_thread)\r
88 +       fputs (format->results_end, stdout);\r
89 +\r
90      return 0;\r
91  }\r
92  \r
93 @@ -258,7 +263,9 @@ do_search_messages (const void *ctx,\r
94      {\r
95         message = notmuch_messages_get (messages);\r
96  \r
97 -       if (! first_message)\r
98 +       if (first_message)\r
99 +           fputs (format->results_start, stdout);\r
100 +       else\r
101             fputs (format->item_sep, stdout);\r
102  \r
103         if (output == OUTPUT_FILES) {\r
104 @@ -276,6 +283,9 @@ do_search_messages (const void *ctx,\r
105  \r
106      notmuch_messages_destroy (messages);\r
107  \r
108 +    if (! first_message)\r
109 +       fputs (format->results_end, stdout);\r
110 +\r
111      return 0;\r
112  }\r
113  \r
114 @@ -415,8 +425,6 @@ notmuch_search_command (void *ctx, int argc, char *argv[])\r
115  \r
116      notmuch_query_set_sort (query, sort);\r
117  \r
118 -    fputs (format->results_start, stdout);\r
119 -\r
120      switch (output) {\r
121      default:\r
122      case OUTPUT_SUMMARY:\r
123 @@ -432,8 +440,6 @@ notmuch_search_command (void *ctx, int argc, char *argv[])\r
124         break;\r
125      }\r
126  \r
127 -    fputs (format->results_end, stdout);\r
128 -\r
129      notmuch_query_destroy (query);\r
130      notmuch_database_close (notmuch);\r
131  \r
132 -- \r
133 1.7.2.3\r
134 \r