1 Return-Path: <too@guru.guru-group.fi>
\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 8A18C429E36
\r
6 for <notmuch@notmuchmail.org>; Wed, 25 Jan 2012 07:21:26 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\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 dh0vufp3OLVM for <notmuch@notmuchmail.org>;
\r
16 Wed, 25 Jan 2012 07:21:25 -0800 (PST)
\r
17 Received: from guru.guru-group.fi (guru-group.fi [87.108.86.66])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 79C7B431FBC
\r
19 for <notmuch@notmuchmail.org>; Wed, 25 Jan 2012 07:21:25 -0800 (PST)
\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)
\r
21 id C3FCA68056; Wed, 25 Jan 2012 17:21:27 +0200 (EET)
\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
23 To: <notmuch@notmuchmail.org>
\r
24 Subject: [RFC PATCH] bikeshed uncrustify options
\r
25 Date: Wed, 25 Jan 2012 17:21:26 +0200
\r
26 Message-Id: <1327504886-8730-1-git-send-email-tomi.ollila@iki.fi>
\r
27 X-Mailer: git-send-email 1.7.6.1
\r
28 Cc: Tomi Ollila <tomi.ollila@iki.fi>
\r
29 X-BeenThere: notmuch@notmuchmail.org
\r
30 X-Mailman-Version: 2.1.13
\r
32 List-Id: "Use and development of the notmuch mail system."
\r
33 <notmuch.notmuchmail.org>
\r
34 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
35 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
36 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
37 List-Post: <mailto:notmuch@notmuchmail.org>
\r
38 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
39 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
40 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
41 X-List-Received-Date: Wed, 25 Jan 2012 15:21:26 -0000
\r
43 Look or try. thoughts ?
\r
47 Is (generally) using *INDENT-(OFF|ON)* ok ?
\r
49 Would it be ok to have
\r
50 #define STRINGIFY(s) STRINGIFY_ (s)
\r
52 (now such expansion disabled by INDENT-OFF)
\r
53 When used, it is still thought as function call,
\r
54 and whitespace added.
\r
56 What about enum { } \n format_sel change below ?
\r
58 After applying this patch and running:
\r
60 $ uncrustify --replace -c devel/uncrustify.cfg *.[ch]
\r
62 one can discuss (at least):
\r
64 * should there be space after '!'
\r
65 * should there be space after (cast)
\r
68 devel/uncrustify.cfg | 3 ++-
\r
69 notmuch-client.h | 5 ++++-
\r
70 notmuch-reply.c | 2 ++
\r
71 notmuch-search.c | 13 +++++++++----
\r
72 notmuch-show.c | 8 ++++++++
\r
73 notmuch-time.c | 3 +++
\r
74 6 files changed, 28 insertions(+), 6 deletions(-)
\r
76 diff --git a/devel/uncrustify.cfg b/devel/uncrustify.cfg
\r
77 index d8075ba..a752fae 100644
\r
78 --- a/devel/uncrustify.cfg
\r
79 +++ b/devel/uncrustify.cfg
\r
80 @@ -58,7 +58,8 @@ nl_after_struct = 0
\r
81 # Extra types used in notmuch source.
\r
82 # (add more on demand)
\r
84 -type GMimeObject mime_node_t
\r
85 +type GMimeObject GMimeCryptoContext GMimeCipherContext
\r
86 +type mime_node_t notmuch_message_t
\r
89 # inter-character spacing options
\r
90 diff --git a/notmuch-client.h b/notmuch-client.h
\r
91 index e0eb594..131e453 100644
\r
92 --- a/notmuch-client.h
\r
93 +++ b/notmuch-client.h
\r
96 #define unused(x) x __attribute__ ((unused))
\r
99 #define STRINGIFY(s) STRINGIFY_(s)
\r
100 #define STRINGIFY_(s) #s
\r
104 struct notmuch_show_params;
\r
105 @@ -377,7 +379,8 @@ mime_node_t *
\r
106 mime_node_child (mime_node_t *parent, int child);
\r
108 /* Return the nth child of node in a depth-first traversal. If n is
\r
109 - * 0, returns node itself. Returns NULL if there is no such part. */
\r
110 + * 0, returns node itself. Returns NULL if there is no such part.
\r
113 mime_node_seek_dfs (mime_node_t *node, int n);
\r
115 diff --git a/notmuch-reply.c b/notmuch-reply.c
\r
116 index f55b1d2..57742c4 100644
\r
117 --- a/notmuch-reply.c
\r
118 +++ b/notmuch-reply.c
\r
119 @@ -31,6 +31,7 @@ static void
\r
120 reply_part_content (GMimeObject *part);
\r
122 static const notmuch_show_format_t format_reply = {
\r
123 +/* *INDENT-OFF* */
\r
126 "", NULL, reply_headers_message_part, ">\n",
\r
127 @@ -44,6 +45,7 @@ static const notmuch_show_format_t format_reply = {
\r
135 diff --git a/notmuch-search.c b/notmuch-search.c
\r
136 index d504051..57ec603 100644
\r
137 --- a/notmuch-search.c
\r
138 +++ b/notmuch-search.c
\r
139 @@ -65,6 +65,7 @@ format_thread_text (const void *ctx,
\r
140 const char *authors,
\r
141 const char *subject);
\r
142 static const search_format_t format_text = {
\r
143 +/* *INDENT-OFF* */
\r
146 format_item_id_text,
\r
147 @@ -75,6 +76,7 @@ static const search_format_t format_text = {
\r
155 @@ -91,6 +93,7 @@ format_thread_json (const void *ctx,
\r
156 const char *authors,
\r
157 const char *subject);
\r
158 static const search_format_t format_json = {
\r
159 +/* *INDENT-OFF* */
\r
162 format_item_id_json,
\r
163 @@ -101,6 +104,7 @@ static const search_format_t format_json = {
\r
171 @@ -160,7 +164,7 @@ format_item_id_json (const void *ctx,
\r
172 printf ("%s", json_quote_str (ctx_quote, item_id));
\r
174 talloc_free (ctx_quote);
\r
180 @@ -333,7 +337,7 @@ do_search_messages (const search_format_t *format,
\r
186 notmuch_filenames_destroy( filenames );
\r
188 } else { /* output == OUTPUT_MESSAGES */
\r
189 @@ -427,8 +431,9 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
\r
190 size_t search_exclude_tags_length;
\r
193 - enum { NOTMUCH_FORMAT_JSON, NOTMUCH_FORMAT_TEXT }
\r
194 - format_sel = NOTMUCH_FORMAT_TEXT;
\r
195 + enum { /* note: also emacs indents this wrongly if not like this. */
\r
196 + NOTMUCH_FORMAT_JSON, NOTMUCH_FORMAT_TEXT
\r
197 + } format_sel = NOTMUCH_FORMAT_TEXT;
\r
199 notmuch_opt_desc_t options[] = {
\r
200 { NOTMUCH_OPT_KEYWORD, &sort, "sort", 's',
\r
201 diff --git a/notmuch-show.c b/notmuch-show.c
\r
202 index dec799c..dfe37bc 100644
\r
203 --- a/notmuch-show.c
\r
204 +++ b/notmuch-show.c
\r
205 @@ -42,6 +42,7 @@ static void
\r
206 format_part_end_text (GMimeObject *part);
\r
208 static const notmuch_show_format_t format_text = {
\r
209 + /* *INDENT-OFF* */
\r
211 "\fmessage{ ", format_message_text,
\r
212 "\fheader{\n", format_headers_text, format_headers_message_part_text, "\fheader}\n",
\r
213 @@ -55,6 +56,7 @@ static const notmuch_show_format_t format_text = {
\r
215 "\fmessage}\n", "",
\r
217 + /* *INDENT-ON* */
\r
221 @@ -89,6 +91,7 @@ static void
\r
222 format_part_end_json (GMimeObject *part);
\r
224 static const notmuch_show_format_t format_json = {
\r
225 + /* *INDENT-OFF* */
\r
227 "{", format_message_json,
\r
228 "\"headers\": {", format_headers_json, format_headers_message_part_json, "}",
\r
229 @@ -102,6 +105,7 @@ static const notmuch_show_format_t format_json = {
\r
233 + /* *INDENT-ON* */
\r
237 @@ -110,6 +114,7 @@ format_message_mbox (const void *ctx,
\r
238 unused (int indent));
\r
240 static const notmuch_show_format_t format_mbox = {
\r
241 + /* *INDENT-OFF* */
\r
243 "", format_message_mbox,
\r
244 "", NULL, NULL, "",
\r
245 @@ -123,12 +128,14 @@ static const notmuch_show_format_t format_mbox = {
\r
249 + /* *INDENT-ON* */
\r
253 format_part_content_raw (GMimeObject *part);
\r
255 static const notmuch_show_format_t format_raw = {
\r
256 + /* *INDENT-OFF* */
\r
259 "", NULL, format_headers_message_part_text, "\n",
\r
260 @@ -142,6 +149,7 @@ static const notmuch_show_format_t format_raw = {
\r
264 + /* *INDENT-ON* */
\r
267 static const char *
\r
268 diff --git a/notmuch-time.c b/notmuch-time.c
\r
269 index e250c3d..a223a99 100644
\r
270 --- a/notmuch-time.c
\r
271 +++ b/notmuch-time.c
\r
273 * (if any) will be reclaimed.
\r
277 #define MINUTE (60)
\r
278 +/* *INDENT-OFF* -- smells like a bug in uncrustify (up to 0.59...) */
\r
279 #define HOUR (60 * MINUTE)
\r
280 #define DAY (24 * HOUR)
\r
282 #define RELATIVE_DATE_MAX 20
\r
284 notmuch_time_relative_date (const void *ctx, time_t then)
\r