Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / 53 / 56a5bf303e4f2b8f8974df649277de1d8447ab
1 Return-Path: <tomi.ollila@iki.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 C6C91431FB6\r
6         for <notmuch@notmuchmail.org>; Sat, 29 Dec 2012 14:02:00 -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\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         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 vTcK6-hQTAXP for <notmuch@notmuchmail.org>;\r
16         Sat, 29 Dec 2012 14:01:57 -0800 (PST)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id 1D448431FAF\r
19         for <notmuch@notmuchmail.org>; Sat, 29 Dec 2012 14:01:57 -0800 (PST)\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
21         by guru.guru-group.fi (Postfix) with ESMTP id 3F9571000CA;\r
22         Sun, 30 Dec 2012 00:01:50 +0200 (EET)\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>\r
24 To: david@tethera.net, notmuch@notmuchmail.org\r
25 Subject: Re: [PATCH] notmuch.c: run uncrustify\r
26 In-Reply-To: <1356536434-15179-1-git-send-email-david@tethera.net>\r
27 References: <1356536434-15179-1-git-send-email-david@tethera.net>\r
28 User-Agent: Notmuch/0.14+216~gd58661f (http://notmuchmail.org) Emacs/24.2.1\r
29         (x86_64-unknown-linux-gnu)\r
30 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
31         $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
32         !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
33 Date: Sun, 30 Dec 2012 00:01:50 +0200\r
34 Message-ID: <m2ehi8sek1.fsf@guru.guru-group.fi>\r
35 MIME-Version: 1.0\r
36 Content-Type: text/plain\r
37 Cc: David Bremner <bremner@debian.org>\r
38 X-BeenThere: notmuch@notmuchmail.org\r
39 X-Mailman-Version: 2.1.13\r
40 Precedence: list\r
41 List-Id: "Use and development of the notmuch mail system."\r
42         <notmuch.notmuchmail.org>\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
46 List-Post: <mailto:notmuch@notmuchmail.org>\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
50 X-List-Received-Date: Sat, 29 Dec 2012 22:02:01 -0000\r
51 \r
52 On Wed, Dec 26 2012, david@tethera.net wrote:\r
53 \r
54 > From: David Bremner <bremner@debian.org>\r
55 >\r
56 > In anticipation of doing some updates to this code, it simplifies life\r
57 > if the code is "uncrustify clean" to start with\r
58 > ---\r
59 \r
60 About an year ago I did some work to preserve format\r
61 type (*funcptr) (args)\r
62 ... i.e. preserve space between (*funcptr) (args) -- among some\r
63 other things uncrustify cannot do. \r
64 We could take a closer look to the whole uncrustify business\r
65 after 0.15 is out.\r
66 \r
67 Tomi\r
68 \r
69 \r
70 >  notmuch.c |   23 +++++++++++------------\r
71 >  1 file changed, 11 insertions(+), 12 deletions(-)\r
72 >\r
73 > diff --git a/notmuch.c b/notmuch.c\r
74 > index 9516dfb..ee2892e 100644\r
75 > --- a/notmuch.c\r
76 > +++ b/notmuch.c\r
77 > @@ -22,7 +22,7 @@\r
78 >  \r
79 >  #include "notmuch-client.h"\r
80 >  \r
81 > -typedef int (*command_function_t) (void *ctx, int argc, char *argv[]);\r
82 > +typedef int (*command_function_t)(void *ctx, int argc, char *argv[]);\r
83 >  \r
84 >  typedef struct command {\r
85 >      const char *name;\r
86 > @@ -39,8 +39,8 @@ typedef struct alias {\r
87 >  } alias_t;\r
88 >  \r
89 >  alias_t aliases[] = {\r
90 > -    { "part", { "show", "--format=raw"}},\r
91 > -    { "search-tags", {"search", "--output=tags", "*"}}\r
92 > +    { "part", { "show", "--format=raw" } },\r
93 > +    { "search-tags", { "search", "--output=tags", "*" } }\r
94 >  };\r
95 >  \r
96 >  static int\r
97 > @@ -66,7 +66,7 @@ static command_t commands[] = {\r
98 >        "[options...] <search-terms> [...]",\r
99 >        "Construct a reply template for a set of messages." },\r
100 >      { "tag", notmuch_tag_command,\r
101 > -      "+<tag>|-<tag> [...] [--] <search-terms> [...]" ,\r
102 > +      "+<tag>|-<tag> [...] [--] <search-terms> [...]",\r
103 >        "Add/remove tags for all messages matching the search terms." },\r
104 >      { "dump", notmuch_dump_command,\r
105 >        "[<filename>] [--] [<search-terms>]",\r
106 > @@ -107,8 +107,8 @@ usage (FILE *out)\r
107 >  \r
108 >      fprintf (out, "\n");\r
109 >      fprintf (out,\r
110 > -    "Use \"notmuch help <command>\" for more details on each command\n"\r
111 > -    "and \"notmuch help search-terms\" for the common search-terms syntax.\n\n");\r
112 > +          "Use \"notmuch help <command>\" for more details on each command\n"\r
113 > +          "and \"notmuch help search-terms\" for the common search-terms syntax.\n\n");\r
114 >  }\r
115 >  \r
116 >  void\r
117 > @@ -281,15 +281,14 @@ main (int argc, char *argv[])\r
118 >       return notmuch_help_command (NULL, argc - 1, &argv[1]);\r
119 >  \r
120 >      if (strcmp (argv[1], "--version") == 0) {\r
121 > -     printf ("notmuch " STRINGIFY(NOTMUCH_VERSION) "\n");\r
122 > +     printf ("notmuch " STRINGIFY (NOTMUCH_VERSION) "\n");\r
123 >       return 0;\r
124 >      }\r
125 >  \r
126 >      for (i = 0; i < ARRAY_SIZE (aliases); i++) {\r
127 >       alias = &aliases[i];\r
128 >  \r
129 > -     if (strcmp (argv[1], alias->name) == 0)\r
130 > -     {\r
131 > +     if (strcmp (argv[1], alias->name) == 0) {\r
132 >           int substitutions;\r
133 >  \r
134 >           argv_local = talloc_size (local, sizeof (char *) *\r
135 > @@ -304,14 +303,14 @@ main (int argc, char *argv[])\r
136 >           for (j = 0; j < MAX_ALIAS_SUBSTITUTIONS; j++) {\r
137 >               if (alias->substitutions[j] == NULL)\r
138 >                   break;\r
139 > -             argv_local[j+1] = alias->substitutions[j];\r
140 > +             argv_local[j + 1] = alias->substitutions[j];\r
141 >           }\r
142 >           substitutions = j;\r
143 >  \r
144 >           /* And copy all original arguments (skipping the argument\r
145 >            * that matched the alias of course. */\r
146 >           for (j = 2; j < (unsigned) argc; j++) {\r
147 > -             argv_local[substitutions+j-1] = argv[j];\r
148 > +             argv_local[substitutions + j - 1] = argv[j];\r
149 >           }\r
150 >  \r
151 >           argc += substitutions - 1;\r
152 > @@ -323,7 +322,7 @@ main (int argc, char *argv[])\r
153 >       command = &commands[i];\r
154 >  \r
155 >       if (strcmp (argv[1], command->name) == 0)\r
156 > -         return (command->function) (local, argc - 1, &argv[1]);\r
157 > +         return (command->function)(local, argc - 1, &argv[1]);\r
158 >      }\r
159 >  \r
160 >      fprintf (stderr, "Error: Unknown command '%s' (see \"notmuch help\")\n",\r
161 > -- \r
162 > 1.7.10.4\r
163 >\r
164 > _______________________________________________\r
165 > notmuch mailing list\r
166 > notmuch@notmuchmail.org\r
167 > http://notmuchmail.org/mailman/listinfo/notmuch\r