Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / 87 / 2bb2716b7f7535637a82dda6752c85e80749ad
1 Return-Path: <amdragon@mit.edu>\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 3319B431FAF\r
6         for <notmuch@notmuchmail.org>; Wed, 24 Oct 2012 14:08:46 -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.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 Xoi3nkTZfeKL for <notmuch@notmuchmail.org>;\r
16         Wed, 24 Oct 2012 14:08:45 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU\r
18         [18.9.25.14])\r
19         by olra.theworths.org (Postfix) with ESMTP id 32D84431FAE\r
20         for <notmuch@notmuchmail.org>; Wed, 24 Oct 2012 14:08:45 -0700 (PDT)\r
21 X-AuditID: 1209190e-b7f756d000000904-9e-508858db5ddf\r
22 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
23         by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id EF.20.02308.BD858805; Wed, 24 Oct 2012 17:08:43 -0400 (EDT)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q9OL8hlk023088; \r
27         Wed, 24 Oct 2012 17:08:43 -0400\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
29         (authenticated bits=0)\r
30         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
31         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q9OL8fgX029227\r
32         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
33         Wed, 24 Oct 2012 17:08:42 -0400 (EDT)\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
35         (envelope-from <amdragon@mit.edu>)\r
36         id 1TR8Bt-0005xj-8m; Wed, 24 Oct 2012 17:08:41 -0400\r
37 Date: Wed, 24 Oct 2012 17:08:41 -0400\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: Jani Nikula <jani@nikula.org>\r
40 Subject: Re: [PATCH v5 8/9] man: document the date:since..until range queries\r
41 Message-ID: <20121024210841.GU14861@mit.edu>\r
42 References: <cover.1350854171.git.jani@nikula.org>\r
43         <cff9c1dd87b8bc11326dca0b3589c81656500f5e.1350854171.git.jani@nikula.org>\r
44 MIME-Version: 1.0\r
45 Content-Type: text/plain; charset=us-ascii\r
46 Content-Disposition: inline\r
47 In-Reply-To:\r
48  <cff9c1dd87b8bc11326dca0b3589c81656500f5e.1350854171.git.jani@nikula.org>\r
49 User-Agent: Mutt/1.5.21 (2010-09-15)\r
50 X-Brightmail-Tracker:\r
51  H4sIAAAAAAAAA+NgFupmleLIzCtJLcpLzFFi42IRYrdT0b0d0RFg8PK5uUXTdGeL6zdnMjsw\r
52         edy6/5rd49mqW8wBTFFcNimpOZllqUX6dglcGZc+dbIWfLWrOLP0P2sDY6NRFyMnh4SAicTE\r
53         ay2MELaYxIV769m6GLk4hAT2MUrs3v2FEcLZwCjx9WcvM0iVkMBJJok/E5Qg7CWMEps+y4HY\r
54         LAKqEvv/vWYDsdkENCS27V8ONlVEQFFi88n9YDazgLTEt9/NTF2M7BzCAr4SR2JBorwCOhJH\r
55         W1awQkysk/j27jcbRFxQ4uTMJywQnVoSN/69BOrkAJuy/B8HSJhTIEzixIuTYCWiAioSU05u\r
56         Y5vAKDQLSfcsJN2zELoXMDKvYpRNya3SzU3MzClOTdYtTk7My0st0jXWy80s0UtNKd3ECApn\r
57         Tkm+HYxfDyodYhTgYFTi4T3g0REgxJpYVlyZe4hRkoNJSZTXMBQoxJeUn1KZkVicEV9UmpNa\r
58         fIhRgoNZSYR38oP2ACHelMTKqtSifJiUNAeLkjjvlZSb/kIC6YklqdmpqQWpRTBZGQ4OJQle\r
59         D2DcCgkWpaanVqRl5pQgpJk4OEGG8wAN1wap4S0uSMwtzkyHyJ9i1OU4+mbuQ0Yhlrz8vFQp\r
60         cd6J4UBFAiBFGaV5cHNgaegVozjQW8K8ciCjeIApDG7SK6AlTEBLzHlaQZaUJCKkpBoYN8sK\r
61         X73cZ/O+/dMWgxcPqq5KLT7gueViAdP71TzXL2Zx95+Y++fN3T43pfkO081cfNuS/Z4prdob\r
62         KHrqn9uKM+oyPN0vj3BqTH/LwfT0kGrcvoXR601/uQX1Rx+09nNefJGpQd7/aLBvyMG2lvff\r
63         itW2muaIHPE6Pr86efUb4QU2l83ZnXUKlFiKMxINtZiLihMB0sexZB4DAAA=\r
64 Cc: notmuch@notmuchmail.org\r
65 X-BeenThere: notmuch@notmuchmail.org\r
66 X-Mailman-Version: 2.1.13\r
67 Precedence: list\r
68 List-Id: "Use and development of the notmuch mail system."\r
69         <notmuch.notmuchmail.org>\r
70 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
71         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
72 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
73 List-Post: <mailto:notmuch@notmuchmail.org>\r
74 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
75 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
76         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
77 X-List-Received-Date: Wed, 24 Oct 2012 21:08:46 -0000\r
78 \r
79 Quoth Jani Nikula on Oct 22 at 12:22 am:\r
80 > ---\r
81 >  man/man7/notmuch-search-terms.7 |  147 +++++++++++++++++++++++++++++++++++----\r
82 >  1 file changed, 135 insertions(+), 12 deletions(-)\r
83\r
84 > diff --git a/man/man7/notmuch-search-terms.7 b/man/man7/notmuch-search-terms.7\r
85 > index 17a109e..fbd3ee7 100644\r
86 > --- a/man/man7/notmuch-search-terms.7\r
87 > +++ b/man/man7/notmuch-search-terms.7\r
88 > @@ -54,6 +54,8 @@ terms to match against specific portions of an email, (where\r
89 >  \r
90 >       folder:<directory-path>\r
91 >  \r
92 > +     date:<since>..<until>\r
93 > +\r
94 >  The\r
95 >  .B from:\r
96 >  prefix is used to match the name or address of the sender of an email\r
97 > @@ -104,6 +106,26 @@ contained within particular directories within the mail store. Only\r
98 >  the directory components below the top-level mail database path are\r
99 >  available to be searched.\r
100 >  \r
101 > +The\r
102 > +.B date:\r
103 > +prefix can be used to restrict the results to only messages within a\r
104 > +particular time range (based on the Date: header) with a range syntax\r
105 > +of:\r
106 > +\r
107 > +     date:<since>..<until>\r
108 > +\r
109 > +See \fBDATE AND TIME SEARCH\fR below for details on the range\r
110 > +expression, and supported syntax for <since> and <until> date and time\r
111 > +expressions.\r
112 > +\r
113 > +The time range can also be specified using timestamps with a syntax\r
114 > +of:\r
115 > +\r
116 > +     <initial-timestamp>..<final-timestamp>\r
117 > +\r
118 > +Each timestamp is a number representing the number of seconds since\r
119 > +1970\-01\-01 00:00:00 UTC.\r
120 > +\r
121 >  In addition to individual terms, multiple terms can be\r
122 >  combined with Boolean operators (\r
123 >  .BR and ", " or ", " not\r
124 > @@ -117,20 +139,121 @@ operators, but will have to be protected from interpretation by the\r
125 >  shell, (such as by putting quotation marks around any parenthesized\r
126 >  expression).\r
127 >  \r
128 > -Finally, results can be restricted to only messages within a\r
129 > -particular time range, (based on the Date: header) with a syntax of:\r
130 > +.SH DATE AND TIME SEARCH\r
131 >  \r
132 > -     <initial-timestamp>..<final-timestamp>\r
133 > +This is a non-exhaustive description of the date and time search with\r
134 > +some pseudo notation. Most of the constructs can be mixed freely, and\r
135 > +in any order, but the same absolute date or time can't be expressed\r
136 > +twice.\r
137 \r
138 I'm not sure what the end of this sentence means, though I assume it's\r
139 related to the restrictions on repeated absolute components.  It would\r
140 also be nice to give a broader view of the syntax here.  Maybe,\r
141 \r
142 notmuch understands a variety of standard and natural ways of\r
143 expressing dates and times, both in absolute terms ("2012-10-24") and\r
144 in relative terms ("yesterday").  Any number of relative terms can be\r
145 combined ("1 hour 25 minutes") and an absolute date/time can be\r
146 combined with relative terms to further adjust it.  A non-exhaustive\r
147 description of the syntax supported for absolute and relative terms is\r
148 given below.\r
149 \r
150 >  \r
151 > -Each timestamp is a number representing the number of seconds since\r
152 > -1970\-01\-01 00:00:00 UTC. This is not the most convenient means of\r
153 > -expressing date ranges, but until notmuch is fixed to accept a more\r
154 > -convenient form, one can use the date program to construct\r
155 > -timestamps. For example, with the bash shell the following syntax would\r
156 > -specify a date range to return messages from 2009\-10\-01 until the\r
157 > -current time:\r
158 > -\r
159 > -     $(date +%s \-d 2009\-10\-01)..$(date +%s)\r
160 > +.RS 4\r
161 > +.TP 4\r
162 > +.B The range expression\r
163 > +\r
164 > +date:<since>..<until>\r
165 > +\r
166 > +The above expression restricts the results to only messages from\r
167 > +<since> to <until>, based on the Date: header.\r
168 > +\r
169 > +If <since> or <until> describes time at an accuracy of days or less,\r
170 > +the date/time is rounded, towards past for <since> and towards future\r
171 > +for <until>, to be inclusive. For example, date:january..february\r
172 \r
173 The accuracy doesn't seem to have have anything to do with days; if I\r
174 say "date:1hour..1hour" I get a span of an hour.  Describing it as\r
175 rounding also seems like it could be confusing to someone who hasn't\r
176 thought a lot about this (though, as someone who has though a lot\r
177 about this, I could be wrong).  What about something like,\r
178 \r
179 <since> and <until> can describe imprecise times, such as "yesterday".\r
180 In this case, <since> is taken as the earliest time it could describe\r
181 (the beginning of yesterday) and <until> is taken as the latest time\r
182 it could describe (the end of yesterday).  Similarly,\r
183 date:january..february matches from the beginning of January to the\r
184 end of February.\r
185 \r
186 > +matches from the beginning of January until the end of\r
187 > +February. Similarly, date:yesterday..yesterday matches from the\r
188 > +beginning of yesterday until the end of yesterday.\r
189 > +\r
190 > +Open-ended ranges are supported (since Xapian 1.2.1), i.e. it's\r
191 > +possible to specify date:..<until> or date:<since>.. to not limit the\r
192 > +start or end time, respectively. Unfortunately, pre-1.2.1 Xapian does\r
193 \r
194 No need for the "Unfortunately".\r
195 \r
196 > +not report an error on open ended ranges, but it does not work as\r
197 > +expected either.\r
198 > +\r
199 > +Xapian does not support spaces in range expressions. You can replace\r
200 \r
201 The man pages essentially don't reference Xapian and the fact that we\r
202 use Xapian is transparent to the uninterested user.  Maybe just\r
203 "Currently, we do not support spaces ..."?  Or "Due to technical\r
204 limitations, we do not currently support spaces ..." if you want to\r
205 convey that we feel the user's pain but it's actually hard to fix.\r
206 \r
207 > +the spaces with '_', or (in most cases) '-', or (in some cases) leave\r
208 > +the spaces out altogether.\r
209 \r
210 Maybe add "Examples in this man page use spaces for clarity."?  It's\r
211 unfortunate that this rather critical piece of information is buried\r
212 in the middle of a subsection of the man page.  I wonder if it should\r
213 at least go before the previous paragraph?  We are going to get so\r
214 many people asking why their date searches don't work...\r
215 \r
216 > +\r
217 > +Entering date:expr without ".." (for example date:yesterday) won't\r
218 > +work, as it's not interpreted as a range expression at all. You can\r
219 > +achieve the expected result by duplicating the expr both sides of ".."\r
220 > +(for example date:yesterday..yesterday).\r
221 > +.RE\r
222 > +\r
223 > +.RS 4\r
224 > +.TP 4\r
225 > +.B Relative date and time\r
226 > +[N|number] (years|months|weeks|days|hours|hrs|minutes|mins|seconds|secs) [...]\r
227 > +\r
228 > +All refer to past, can be repeated and will be accumulated.\r
229 > +\r
230 > +Units can be abbreviated to any length, with the otherwise ambiguous\r
231 > +single m being m for minutes and M for months.\r
232 > +\r
233 > +Number multiplier can also be written out one, two, ..., ten, dozen,\r
234 \r
235 This is the only use of "multiplier".  I think it would be fine to\r
236 just say "the number".\r
237 \r
238 > +hundred. As special cases last means one ("last week") and this means\r
239 > +zero ("this month").\r
240 \r
241 Maybe, "Additionally, the unit may be preceded by "last" or "this"\r
242 (e.g., "last week" or "this month")."?\r
243 \r
244 > +\r
245 > +When combined with absolute date and time, the relative date and time\r
246 > +specification will be relative from the specified absolute date and\r
247 > +time.\r
248 > +\r
249 > +Examples: 5M2d, two weeks\r
250 > +.RE\r
251 > +\r
252 > +.RS 4\r
253 > +.TP 4\r
254 > +.B Supported time formats\r
255 \r
256 Supported absolute time formats?\r
257 \r
258 > +H[H]:MM[:SS] [(am|a.m.|pm|p.m.)]\r
259 > +\r
260 > +H[H] (am|a.m.|pm|p.m.)\r
261 > +\r
262 > +HHMMSS\r
263 > +\r
264 > +now\r
265 > +\r
266 > +noon\r
267 > +\r
268 > +midnight\r
269 > +\r
270 > +Examples: 17:05, 5pm\r
271 > +.RE\r
272 > +\r
273 > +.RS 4\r
274 > +.TP 4\r
275 > +.B Supported date formats\r
276 \r
277 Supported absolute date formats?\r
278 \r
279 > +YYYY-MM[-DD]\r
280 > +\r
281 > +DD-MM[-[YY]YY]\r
282 > +\r
283 > +MM-YYYY\r
284 > +\r
285 > +M[M]/D[D][/[YY]YY]\r
286 > +\r
287 > +M[M]/YYYY\r
288 > +\r
289 > +D[D].M[M][.[YY]YY]\r
290 > +\r
291 > +D[D][(st|nd|rd|th)] Mon[thname] [YYYY]\r
292 > +\r
293 > +Mon[thname] D[D][(st|nd|rd|th)] [YYYY]\r
294 > +\r
295 > +Wee[kday]\r
296 > +\r
297 > +Month names can be abbreviated at three or more characters.\r
298 > +\r
299 > +Weekday names can be abbreviated at three or more characters.\r
300 > +\r
301 > +Examples: 2012-07-31, 31-07-2012, 7/31/2012, August 3\r
302 > +.RE\r
303 > +\r
304 > +.RS 4\r
305 > +.TP 4\r
306 > +.B Time zones\r
307 > +(+|-)HH:MM\r
308 > +\r
309 > +(+|-)HH[MM]\r
310 > +\r
311 > +Some time zone codes, e.g. UTC, EET.\r
312 > +.RE\r
313 >  \r
314 >  .SH SEE ALSO\r
315 >  \r