Re: [PATCH 0/4] Allow specifying alternate names for addresses in other_email
[notmuch-archives.git] / 4e / e2a208dcc22a138b9b04ff88c024d5a57b8fd9
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 olra.theworths.org (Postfix) with ESMTP id B089D429E36\r
6         for <notmuch@notmuchmail.org>; Wed, 25 Jan 2012 07:48:09 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\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 TPXGcwaIso-G for <notmuch@notmuchmail.org>;\r
16         Wed, 25 Jan 2012 07:48:08 -0800 (PST)\r
17 Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com\r
18         [209.85.216.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id B88DF431FBC\r
21         for <notmuch@notmuchmail.org>; Wed, 25 Jan 2012 07:48:08 -0800 (PST)\r
22 Received: by qcpx40 with SMTP id x40so3367323qcp.26\r
23         for <notmuch@notmuchmail.org>; Wed, 25 Jan 2012 07:48:08 -0800 (PST)\r
24 Received: by 10.224.42.10 with SMTP id q10mr44548qae.26.1327506488064;\r
25         Wed, 25 Jan 2012 07:48:08 -0800 (PST)\r
26 Received: from localhost (nikula.org. [92.243.24.172])\r
27         by mx.google.com with ESMTPS id de9sm2594899qab.9.2012.01.25.07.48.05\r
28         (version=SSLv3 cipher=OTHER); Wed, 25 Jan 2012 07:48:06 -0800 (PST)\r
29 From: Jani Nikula <jani@nikula.org>\r
30 To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org\r
31 Subject: Re: [RFC PATCH] bikeshed uncrustify options\r
32 In-Reply-To: <1327504886-8730-1-git-send-email-tomi.ollila@iki.fi>\r
33 References: <1327504886-8730-1-git-send-email-tomi.ollila@iki.fi>\r
34 User-Agent: Notmuch/0.10.2+187~g43d4f26 (http://notmuchmail.org) Emacs/23.1.1\r
35         (i686-pc-linux-gnu)\r
36 Date: Wed, 25 Jan 2012 15:48:03 +0000\r
37 Message-ID: <87mx9b6ax8.fsf@nikula.org>\r
38 MIME-Version: 1.0\r
39 X-Gm-Message-State:\r
40  ALoCoQlheOU+uLcHSeG2NgvKMiZUYSB4naQur7fYrP3WERwYIVvaDDWuRojSmpseecKYIe6kq5bf\r
41 Content-Type: text/plain; charset=us-ascii\r
42 Cc: Tomi Ollila <tomi.ollila@iki.fi>\r
43 X-BeenThere: notmuch@notmuchmail.org\r
44 X-Mailman-Version: 2.1.13\r
45 Precedence: list\r
46 List-Id: "Use and development of the notmuch mail system."\r
47         <notmuch.notmuchmail.org>\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
51 List-Post: <mailto:notmuch@notmuchmail.org>\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
55 X-List-Received-Date: Wed, 25 Jan 2012 15:48:09 -0000\r
56 \r
57 \r
58 Coding style bikeshedding, wonderful. :)\r
59 \r
60 On Wed, 25 Jan 2012 17:21:26 +0200, Tomi Ollila <tomi.ollila@iki.fi> wrote:\r
61 > Is (generally) using *INDENT-(OFF|ON)*  ok ? \r
62 \r
63 Obviously I wish we could do without.\r
64 \r
65 You should cook up a wrapper for uncrustify that takes a patch, applies\r
66 it, and checks if it introduces new coding style issues, but ignores the\r
67 existing ones. ;)\r
68 \r
69 > Would it be ok to have\r
70 > #define STRINGIFY(s) STRINGIFY_ (s)\r
71 \r
72 Why not, it's the notmuch style?\r
73 \r
74 > (now such expansion disabled by INDENT-OFF)\r
75 > When used, it is still thought as function call,\r
76 > and whitespace added.\r
77\r
78 > What about enum { } \n format_sel change below ?\r
79 \r
80 See comment inline below.\r
81 \r
82 > After applying this patch and running:\r
83\r
84 > $ uncrustify --replace -c devel/uncrustify.cfg *.[ch]\r
85\r
86 > one can discuss (at least):\r
87\r
88 > * should there be space after '!'\r
89 \r
90 That's like having space in '- foo' or '~ foo', isn't it? I'd prefer no\r
91 space after unary operators.\r
92 \r
93 > * should there be space after (cast)\r
94 \r
95 Yes, please.\r
96 \r
97\r
98 > ---\r
99 >  devel/uncrustify.cfg |    3 ++-\r
100 >  notmuch-client.h     |    5 ++++-\r
101 >  notmuch-reply.c      |    2 ++\r
102 >  notmuch-search.c     |   13 +++++++++----\r
103 >  notmuch-show.c       |    8 ++++++++\r
104 >  notmuch-time.c       |    3 +++\r
105 >  6 files changed, 28 insertions(+), 6 deletions(-)\r
106\r
107 > diff --git a/devel/uncrustify.cfg b/devel/uncrustify.cfg\r
108 > index d8075ba..a752fae 100644\r
109 > --- a/devel/uncrustify.cfg\r
110 > +++ b/devel/uncrustify.cfg\r
111 > @@ -58,7 +58,8 @@ nl_after_struct = 0\r
112 >  # Extra types used in notmuch source.\r
113 >  # (add more on demand)\r
114 >  \r
115 > -type GMimeObject mime_node_t\r
116 > +type GMimeObject GMimeCryptoContext GMimeCipherContext\r
117 > +type mime_node_t notmuch_message_t\r
118 >  \r
119 >  #\r
120 >  # inter-character spacing options\r
121 > diff --git a/notmuch-client.h b/notmuch-client.h\r
122 > index e0eb594..131e453 100644\r
123 > --- a/notmuch-client.h\r
124 > +++ b/notmuch-client.h\r
125 > @@ -59,8 +59,10 @@\r
126 >  \r
127 >  #define unused(x) x __attribute__ ((unused))\r
128 >  \r
129 > +/* *INDENT-OFF* */\r
130 >  #define STRINGIFY(s) STRINGIFY_(s)\r
131 >  #define STRINGIFY_(s) #s\r
132 > +/* *INDENT-ON* */\r
133 >  \r
134 >  struct mime_node;\r
135 >  struct notmuch_show_params;\r
136 > @@ -377,7 +379,8 @@ mime_node_t *\r
137 >  mime_node_child (mime_node_t *parent, int child);\r
138 >  \r
139 >  /* Return the nth child of node in a depth-first traversal.  If n is\r
140 > - * 0, returns node itself.  Returns NULL if there is no such part. */\r
141 > + * 0, returns node itself.  Returns NULL if there is no such part.\r
142 > + */\r
143 >  mime_node_t *\r
144 >  mime_node_seek_dfs (mime_node_t *node, int n);\r
145 >  \r
146 > diff --git a/notmuch-reply.c b/notmuch-reply.c\r
147 > index f55b1d2..57742c4 100644\r
148 > --- a/notmuch-reply.c\r
149 > +++ b/notmuch-reply.c\r
150 > @@ -31,6 +31,7 @@ static void\r
151 >  reply_part_content (GMimeObject *part);\r
152 >  \r
153 >  static const notmuch_show_format_t format_reply = {\r
154 > +/* *INDENT-OFF* */\r
155 \r
156 What does it do here without the comment?\r
157 \r
158 >      "", NULL,\r
159 >       "", NULL,\r
160 >           "", NULL, reply_headers_message_part, ">\n",\r
161 > @@ -44,6 +45,7 @@ static const notmuch_show_format_t format_reply = {\r
162 >           "",\r
163 >       "", "",\r
164 >      ""\r
165 > +/* *INDENT-ON* */\r
166 >  };\r
167 >  \r
168 >  static void\r
169 > diff --git a/notmuch-search.c b/notmuch-search.c\r
170 > index d504051..57ec603 100644\r
171 > --- a/notmuch-search.c\r
172 > +++ b/notmuch-search.c\r
173 > @@ -65,6 +65,7 @@ format_thread_text (const void *ctx,\r
174 >                   const char *authors,\r
175 >                   const char *subject);\r
176 >  static const search_format_t format_text = {\r
177 > +/* *INDENT-OFF* */\r
178 >      "",\r
179 >       "",\r
180 >           format_item_id_text,\r
181 > @@ -75,6 +76,7 @@ static const search_format_t format_text = {\r
182 >       "",\r
183 >      "\n",\r
184 >      "",\r
185 > +/* *INDENT-ON* */\r
186 >  };\r
187 >  \r
188 >  static void\r
189 > @@ -91,6 +93,7 @@ format_thread_json (const void *ctx,\r
190 >                   const char *authors,\r
191 >                   const char *subject);\r
192 >  static const search_format_t format_json = {\r
193 > +/* *INDENT-OFF* */\r
194 >      "[",\r
195 >       "{",\r
196 >           format_item_id_json,\r
197 > @@ -101,6 +104,7 @@ static const search_format_t format_json = {\r
198 >       "}",\r
199 >      "]\n",\r
200 >      "]\n",\r
201 > +/* *INDENT-ON* */\r
202 >  };\r
203 >  \r
204 >  static void\r
205 > @@ -160,7 +164,7 @@ format_item_id_json (const void *ctx,\r
206 >      printf ("%s", json_quote_str (ctx_quote, item_id));\r
207 >  \r
208 >      talloc_free (ctx_quote);\r
209 > -    \r
210 > +\r
211 >  }\r
212 >  \r
213 >  static void\r
214 > @@ -333,7 +337,7 @@ do_search_messages (const search_format_t *format,\r
215 >  \r
216 >               first_message = 0;\r
217 >           }\r
218 > -         \r
219 > +\r
220 >           notmuch_filenames_destroy( filenames );\r
221 >  \r
222 >       } else { /* output == OUTPUT_MESSAGES */\r
223 > @@ -427,8 +431,9 @@ notmuch_search_command (void *ctx, int argc, char *argv[])\r
224 >      size_t search_exclude_tags_length;\r
225 >      unsigned int i;\r
226 >  \r
227 > -    enum { NOTMUCH_FORMAT_JSON, NOTMUCH_FORMAT_TEXT }\r
228 > -     format_sel = NOTMUCH_FORMAT_TEXT;\r
229 > +    enum { /* note: also emacs indents this wrongly if not like this. */\r
230 > +     NOTMUCH_FORMAT_JSON, NOTMUCH_FORMAT_TEXT\r
231 > +    } format_sel = NOTMUCH_FORMAT_TEXT;\r
232 \r
233 I prefer this style anyway. Compare with:\r
234 \r
235         struct { int foo; int bar; } baz;\r
236 \r
237 which I think would be frowned upon.\r
238 \r
239 >  \r
240 >      notmuch_opt_desc_t options[] = {\r
241 >       { NOTMUCH_OPT_KEYWORD, &sort, "sort", 's',\r
242 > diff --git a/notmuch-show.c b/notmuch-show.c\r
243 > index dec799c..dfe37bc 100644\r
244 > --- a/notmuch-show.c\r
245 > +++ b/notmuch-show.c\r
246 > @@ -42,6 +42,7 @@ static void\r
247 >  format_part_end_text (GMimeObject *part);\r
248 >  \r
249 >  static const notmuch_show_format_t format_text = {\r
250 > +    /* *INDENT-OFF* */\r
251 >      "", NULL,\r
252 >       "\fmessage{ ", format_message_text,\r
253 >           "\fheader{\n", format_headers_text, format_headers_message_part_text, "\fheader}\n",\r
254 > @@ -55,6 +56,7 @@ static const notmuch_show_format_t format_text = {\r
255 >           "\fbody}\n",\r
256 >       "\fmessage}\n", "",\r
257 >      ""\r
258 > +    /* *INDENT-ON* */\r
259 >  };\r
260 >  \r
261 >  static void\r
262 > @@ -89,6 +91,7 @@ static void\r
263 >  format_part_end_json (GMimeObject *part);\r
264 >  \r
265 >  static const notmuch_show_format_t format_json = {\r
266 > +    /* *INDENT-OFF* */\r
267 >      "[", NULL,\r
268 >       "{", format_message_json,\r
269 >           "\"headers\": {", format_headers_json, format_headers_message_part_json, "}",\r
270 > @@ -102,6 +105,7 @@ static const notmuch_show_format_t format_json = {\r
271 >           "]",\r
272 >       "}", ", ",\r
273 >      "]"\r
274 > +    /* *INDENT-ON* */\r
275 >  };\r
276 >  \r
277 >  static void\r
278 > @@ -110,6 +114,7 @@ format_message_mbox (const void *ctx,\r
279 >                    unused (int indent));\r
280 >  \r
281 >  static const notmuch_show_format_t format_mbox = {\r
282 > +    /* *INDENT-OFF* */\r
283 >      "", NULL,\r
284 >          "", format_message_mbox,\r
285 >              "", NULL, NULL, "",\r
286 > @@ -123,12 +128,14 @@ static const notmuch_show_format_t format_mbox = {\r
287 >              "",\r
288 >          "", "",\r
289 >      ""\r
290 > +    /* *INDENT-ON* */\r
291 >  };\r
292 >  \r
293 >  static void\r
294 >  format_part_content_raw (GMimeObject *part);\r
295 >  \r
296 >  static const notmuch_show_format_t format_raw = {\r
297 > +    /* *INDENT-OFF* */\r
298 >      "", NULL,\r
299 >       "", NULL,\r
300 >           "", NULL, format_headers_message_part_text, "\n",\r
301 > @@ -142,6 +149,7 @@ static const notmuch_show_format_t format_raw = {\r
302 >              "",\r
303 >       "", "",\r
304 >      ""\r
305 > +    /* *INDENT-ON* */\r
306 >  };\r
307 >  \r
308 >  static const char *\r
309 > diff --git a/notmuch-time.c b/notmuch-time.c\r
310 > index e250c3d..a223a99 100644\r
311 > --- a/notmuch-time.c\r
312 > +++ b/notmuch-time.c\r
313 > @@ -38,9 +38,12 @@\r
314 >   * (if any) will be reclaimed.\r
315 >   *\r
316 >   */\r
317 > +\r
318 >  #define MINUTE (60)\r
319 > +/* *INDENT-OFF* -- smells like a bug in uncrustify (up to 0.59...) */\r
320 >  #define HOUR (60 * MINUTE)\r
321 >  #define DAY (24 * HOUR)\r
322 > +/* *INDENT-ON* */\r
323 >  #define RELATIVE_DATE_MAX 20\r
324 >  const char *\r
325 >  notmuch_time_relative_date (const void *ctx, time_t then)\r
326 > -- \r
327 > 1.7.8.2\r
328\r
329 > _______________________________________________\r
330 > notmuch mailing list\r
331 > notmuch@notmuchmail.org\r
332 > http://notmuchmail.org/mailman/listinfo/notmuch\r