Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / ef / 4f6573ce9407c4e43134a488d693d030410f5c
1 Return-Path: <cworth@cworth.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 8A8E1431FD0\r
6         for <notmuch@notmuchmail.org>; Fri, 24 Jun 2011 11:29:29 -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\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 WO6bWpUe7HEF for <notmuch@notmuchmail.org>;\r
16         Fri, 24 Jun 2011 11:29:28 -0700 (PDT)\r
17 Received: from arlo.cworth.org (arlo.cworth.org [50.43.72.2])\r
18         by olra.theworths.org (Postfix) with ESMTP id 9547F431FB6\r
19         for <notmuch@notmuchmail.org>; Fri, 24 Jun 2011 11:29:28 -0700 (PDT)\r
20 Received: from yoom.home.cworth.org (localhost [127.0.0.1])\r
21         by arlo.cworth.org (Postfix) with ESMTP id 730D729A4FF;\r
22         Fri, 24 Jun 2011 11:29:27 -0700 (PDT)\r
23 Received: by yoom.home.cworth.org (Postfix, from userid 1000)\r
24         id 633E0254157; Fri, 24 Jun 2011 11:29:27 -0700 (PDT)\r
25 From: Carl Worth <cworth@cworth.org>\r
26 To: ccx@te2000.cz, notmuch@notmuchmail.org\r
27 Subject: Re: Notmuch scripts\r
28 In-Reply-To: <20110624112820.GA26201@dorje.inet.te2000>\r
29 References: <20110624112820.GA26201@dorje.inet.te2000>\r
30 User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1\r
31         (i486-pc-linux-gnu)\r
32 Date: Fri, 24 Jun 2011 11:29:21 -0700\r
33 Message-ID: <8762nvccce.fsf@yoom.home.cworth.org>\r
34 MIME-Version: 1.0\r
35 Content-Type: multipart/signed; boundary="=-=-=";\r
36         micalg=pgp-sha1; protocol="application/pgp-signature"\r
37 X-BeenThere: notmuch@notmuchmail.org\r
38 X-Mailman-Version: 2.1.13\r
39 Precedence: list\r
40 List-Id: "Use and development of the notmuch mail system."\r
41         <notmuch.notmuchmail.org>\r
42 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
43         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
44 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
45 List-Post: <mailto:notmuch@notmuchmail.org>\r
46 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
47 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
49 X-List-Received-Date: Fri, 24 Jun 2011 18:29:29 -0000\r
50 \r
51 --=-=-=\r
52 Content-Type: text/plain; charset=utf-8\r
53 Content-Transfer-Encoding: quoted-printable\r
54 \r
55 On Fri, 24 Jun 2011 13:28:21 +0200, ccx@te2000.cz wrote:\r
56 > As some of you know I have written several scripts that aid using\r
57 > notmuch, including an alternative to the notmuch-mutt perl script.\r
58 \r
59 Thanks for sharing these, Jan!\r
60 \r
61 > Since Carl Worth consented to include them into official distribution\r
62 > I am now cleaning them up, writing docs and extending it so it covers\r
63 > all features notmuch-mutt currently has.\r
64 ...\r
65 > Or you can browse the code at:\r
66 >       http://webprojekty.cz/ccx/loggerhead/zmuch/files\r
67 \r
68 It's been interesting for me to read through the README here.\r
69 \r
70 So much of the new functionality here consists of things I'd love to\r
71 have implemented in the core command-line interface of notmuch, (I\r
72 always have wanted it to be useful for direct command-line interaction\r
73 by a human). Some of these features I think have even be implemented\r
74 previously by Austin through his custom query parser.\r
75 \r
76 The features I see that I'd really like to see in the core notmuch\r
77 command-line tool are:\r
78 \r
79         * Configurable "saved searches", (a syntax for expanding aliases\r
80           for often-repeated search specifications).\r
81 \r
82           That's an idea we've had for a while. What's new with the\r
83           zmuch implementation is the proposal of ":alias" for the\r
84           syntax. I think I might like that quite a bit. It looks a bit\r
85           easier to read (and type) than the previously-proposed\r
86           "{alias}".\r
87 \r
88         * Delivery of search results to a maildir of symlinks\r
89 \r
90           The zmuch implementation has this functionality intertwined\r
91           with something that also invokes mutt. Obviously, people using\r
92           other MUAs might like to access this feature independently.\r
93 \r
94           I think I'd like to see this as:\r
95 \r
96                 notmuch search --format=3Dmaildir:/path/to/directory\r
97 \r
98         * Operations on files matching search terms (move, remove,\r
99           xargs)\r
100 \r
101           This isn't an operation I'd previously considered including in\r
102           notmuch, but it does seem generally quite useful.\r
103 \r
104           Should we consider doing something like git does and allow\r
105           something like "notmuch xargs" simply find and invoke a shell\r
106           script named notmuch-xargs?\r
107 \r
108           Doing that could let us get a bunch of this functionality in\r
109           place in the "core" sooner than if we waited for it to be\r
110           re-implemented in C.\r
111 \r
112           Though if we did this, I think I'd be highly inclined to port\r
113           the scripts from zsh to bash or even POSIX sh. How hard would\r
114           that be?\r
115 \r
116         * Better date syntax for search specifications\r
117 \r
118           That's something that's obviously been missing from notmuch\r
119           core from the beginning. And there have been several proposals\r
120           with patches to do this in various ways.\r
121 \r
122         * Implicit concatenation of search terms with OR\r
123 \r
124           This seems like something easy to do with a command-line\r
125           arguemnt. Perhaps "notmuch search --or ..." ?\r
126 \r
127 If we got all that into the core, then what would be left here would be:\r
128 \r
129         notmuch-mailvars.sh\r
130         notmuch-mutt.sh\r
131 \r
132                 These would provide integration of notmuch with mutt.\r
133 \r
134         notmuch-spam.sh\r
135         notmuch-unspam.sh\r
136 \r
137                 These would provide integration of notmuch with\r
138                 bsfilter, (and perhaps should be named to make that more\r
139                 clear---or generalized to justify the current name).\r
140 \r
141         notmuch-pager.sh\r
142 \r
143                 I haven't looked at this to see what the colorization\r
144                 actually looks like, (I'm not always a huge fan of lots\r
145                 of color in my terminals). It seems that this would be\r
146                 more cleanly implemented as notmuch-colorize.sh or so\r
147                 and leave the pagination separate.\r
148 \r
149 If we had that, I'd feel really comfortable having each of those in\r
150 contrib. I think contrib should be restricted to things which provide\r
151 integration of notmuch with some external tool, (and should make that\r
152 obvious by having a name like notmuch-<tool> or notmuch-<tool>.sh or\r
153 whatever).\r
154 \r
155 All in all, there's definitely some very interesting functionality here,\r
156 and I definitely appreciate you sharing it. Let's figure out the best\r
157 way to get it all integrated into notmuch.\r
158 \r
159 Maybe in the meantime we throw everything into contrib even if some of\r
160 it is seen as just proposals for better interfaces in the core tool? I\r
161 don't know.\r
162 \r
163 >   * Every application that does not act as a proxy should use\r
164 >     environment variable NOTMUCH to find the actual notmuch executable.\r
165 >=20\r
166 >   * Every application that acts as a proxy should ignore the NOTMUCH\r
167 >       variable\r
168 \r
169 That sounds reasonable enough to me. Perhaps these rules could go into a\r
170 new contrib/README that would set out some guidelines for writing\r
171 contrib tools, (such as notmuch-<tool> which I mentioned above).\r
172 \r
173 > Configuration and temporary files:\r
174 > I like XDG specification.\r
175 \r
176 I'm missing some context to know what you're suggesting here.\r
177 \r
178 > I think it's bit unnecessary to have to have\r
179 > config files that belong only to few scripts littered all around my\r
180 > homedir.\r
181 \r
182 We should be able to put configuration for contrib tools into the main\r
183 notmuch configuration file. If your tools don't want to read that file\r
184 directly, they should be able to get by with the interfaces provided by\r
185 "notmuch config set" and "notmuch config get". Obviously, each tool\r
186 should create its own section in the configuration file.\r
187 \r
188 Is that an insane plan?\r
189 \r
190 >   * Spam filter. Do you guys use any? What does it's interface look like?\r
191 >     I currently use bsfilter which I've found does it's job pretty\r
192 >     well.\r
193 \r
194 I've currently got amavis and spamassassin adding extra headers, (and\r
195 below a certain threshold I've got maildrop delivering detected spam to\r
196 a separate maildir).\r
197 \r
198 Currently, notmuch never sees the detected spam. Ever since we got\r
199 folder: support I've been meaning to let notmuch see it so that I can\r
200 use notmuch to dig into my spam when I suspect something got\r
201 mis-detected.\r
202 \r
203 I don't currently have any system for getting user-provided feedback\r
204 into my spam filtering. Do you get that with bsfilter?\r
205 \r
206 >   * Colors. I use bright fg on dark bg, but I understand somebody won't\r
207 >     be happy with this choice.\r
208 \r
209 I'm pretty-much black-on-white only. I really want a similar experience\r
210 with my computer that I get from books. (Though I'm still waiting for\r
211 much better contrast from my computer displays=E2=80=94e-ink definitely hel=\r
212 ps a\r
213 lot for the very static use cases).\r
214 \r
215 >   * New message processing. Currently I check for spam and I mute\r
216 >     selected threads. I can see this can be made quite configurable.\r
217 >       Maybe create procmail equivalent for notmuch? :-)\r
218 \r
219 I think lots of us have various hand-written scripts that call out to\r
220 "notmuch tag" a bunch. It's definitely a common idiom to have "notmuch\r
221 new" add a new tag, have the new-mail-processing script operate on\r
222 tag:new, and then have that script remove tag:new from the things it\r
223 processed.\r
224 \r
225 An alternative approach has been proposed to make "notmuch new" able to\r
226 act on specified messages, (and accept an explicit list of tags to\r
227 add). That would make it much easier to actually use existing tools like\r
228 procmail directly with notmuch. Some people are currently using the\r
229 notmuch-deliver.sh script in use cases like this. (And that script is\r
230 another existing candidate for contrib.)\r
231 \r
232 =2DCarl\r
233 \r
234 =2D-=20\r
235 carl.d.worth@intel.com\r
236 \r
237 --=-=-=\r
238 Content-Type: application/pgp-signature\r
239 \r
240 -----BEGIN PGP SIGNATURE-----\r
241 Version: GnuPG v1.4.11 (GNU/Linux)\r
242 \r
243 iEYEARECAAYFAk4E14EACgkQ6JDdNq8qSWhD7wCgg9onbYJXWTFyJp6DQr1Gdbvh\r
244 pKIAoJDujLvSloL8CzRL7AXtxZVSc4XT\r
245 =u3I8\r
246 -----END PGP SIGNATURE-----\r
247 --=-=-=--\r