1 Return-Path: <Sebastian@SSpaeth.de>
\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 E0C5B431FC7
\r
6 for <notmuch@notmuchmail.org>; Mon, 8 Feb 2010 03:14:24 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.746 tagged_above=-999 required=5 tests=[AWL=0.853,
\r
12 BAYES_00=-2.599] autolearn=ham
\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 08FTNnfUSLki for <notmuch@notmuchmail.org>;
\r
16 Mon, 8 Feb 2010 03:14:22 -0800 (PST)
\r
17 Received: from homiemail-a11.g.dreamhost.com (caiajhbdcbhh.dreamhost.com
\r
19 by olra.theworths.org (Postfix) with ESMTP id 4F7F9431FAE
\r
20 for <notmuch@notmuchmail.org>; Mon, 8 Feb 2010 03:14:19 -0800 (PST)
\r
21 Received: from localhost.localdomain (mtec-hg-docking-1-dhcp-204.ethz.ch
\r
23 by homiemail-a11.g.dreamhost.com (Postfix) with ESMTPA id 3D80319406D;
\r
24 Mon, 8 Feb 2010 03:14:18 -0800 (PST)
\r
25 From: Sebastian Spaeth <Sebastian@SSpaeth.de>
\r
26 To: notmuch@notmuchmail.org
\r
27 Date: Mon, 8 Feb 2010 12:14:12 +0100
\r
28 Message-Id: <1265627652-25912-4-git-send-email-Sebastian@SSpaeth.de>
\r
29 X-Mailer: git-send-email 1.6.3.3
\r
30 In-Reply-To: <1265627652-25912-3-git-send-email-Sebastian@SSpaeth.de>
\r
31 References: <87fx5cjc83.fsf@SSpaeth.de>
\r
32 <1265627652-25912-1-git-send-email-Sebastian@SSpaeth.de>
\r
33 <1265627652-25912-2-git-send-email-Sebastian@SSpaeth.de>
\r
34 <1265627652-25912-3-git-send-email-Sebastian@SSpaeth.de>
\r
35 Subject: [notmuch] [PATCH 4/4] add documentation for the new daterange
\r
36 parser and remove TODO list item
\r
37 X-BeenThere: notmuch@notmuchmail.org
\r
38 X-Mailman-Version: 2.1.13
\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: Mon, 08 Feb 2010 11:14:25 -0000
\r
51 Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
\r
54 notmuch.1 | 29 ++++++++++++++++++++---------
\r
55 notmuch.c | 24 +++++++++++++-----------
\r
56 3 files changed, 33 insertions(+), 29 deletions(-)
\r
58 diff --git a/TODO b/TODO
\r
59 index bdfe64c..86cbf74 100644
\r
62 @@ -114,15 +114,6 @@ notmuch library
\r
64 Index content from citations, please.
\r
66 -Provide a sane syntax for date ranges. First, we don't want to require
\r
67 -both endpoints to be specified. For example it would be nice to be
\r
68 -able to say things like "since:2009-01-1" or "until:2009-01-1" and
\r
69 -have the other endpoint be implicit. Second we'd like to support
\r
70 -relative specifications of time such as "since:'2 months ago'". To do
\r
71 -any of this we're probably going to need to break down an write our
\r
72 -own parser for the query string rather than using Xapian's QueryParser
\r
75 Make failure to read a file (such as a permissions problem) a warning
\r
76 rather than an error (should be similar to the existing warning for a
\r
78 diff --git a/notmuch.1 b/notmuch.1
\r
79 index 282ad98..19628f0 100644
\r
82 @@ -413,17 +413,28 @@ expression).
\r
83 Finally, results can be restricted to only messages within a
\r
84 particular time range, (based on the Date: header) with a syntax of:
\r
86 - <intial-timestamp>..<final-timestamp>
\r
87 + date:<startdate>..<enddate>
\r
89 -Each timestamp is a number representing the number of seconds since
\r
90 -1970-01-01 00:00:00 UTC. This is not the most convenient means of
\r
91 -expressing date ranges, but until notmuch is fixed to accept a more
\r
92 -convenient form, one can use the date program to construct
\r
93 -timestamps. For example, with the bash shell the folowing syntax would
\r
94 -specify a date range to return messages from 2009-10-01 until the
\r
98 +can be specified in various formats. It parses the formats in this order and stops if one pattern matches:
\r
108 + Month-day: month[-day]] (month: "January", "Jan", 1)
\r
110 + ISO format: year[-month[-day]]
\r
112 + US format : month[/day[/year]]
\r
114 +The date parser will try to fill in bits in the enddate from context if left out, e.g. a 'date:2004..01' will find from 2004-01-01 through 2004-01-31.
\r
116 - $(date +%s -d 2009-10-01)..$(date +%s)
\r
118 The emacs-based interface to notmuch (available as
\r
120 diff --git a/notmuch.c b/notmuch.c
\r
121 index 87479f8..b8fe01a 100644
\r
124 @@ -92,19 +92,21 @@ static const char search_terms_help[] =
\r
125 "\t\tmarks around any parenthesized expression).\n"
\r
127 "\t\tFinally, results can be restricted to only messages within a\n"
\r
128 - "\t\tparticular time range, (based on the Date: header) with:\n"
\r
129 + "\t\tparticular time range, (based on the Date: header) with a\n"
\r
130 + "\t\tsyntax of: date:<startdate>..<enddate>\n"
\r
132 - "\t\t\t<intial-timestamp>..<final-timestamp>\n"
\r
133 + "\t\tIt can be specified in the following formats, parsing will \n"
\r
134 + "\t\tstop if the first pattern matches:\n"
\r
135 + "\t\tKeywords: 'today','yesterday','thisweek','lastweek',\n"
\r
136 + "\t\t'thismonth', 'lastmonth'. \n"
\r
137 + "\t\tmonth-day : month[-day]] (month: January, Jan, or 1)\n"
\r
138 + "\t\tISO format: year[-month[-day]] (month: January, Jan, or 1)\n"
\r
139 + "\t\tUS format : month[/day[/year]]\n"
\r
141 - "\t\tEach timestamp is a number representing the number of seconds\n"
\r
142 - "\t\tsince 1970-01-01 00:00:00 UTC. This is not the most convenient\n"
\r
143 - "\t\tmeans of expressing date ranges, but until notmuch is fixed to\n"
\r
144 - "\t\taccept a more convenient form, one can use the date program to\n"
\r
145 - "\t\tconstruct timestamps. For example, with the bash shell the\n"
\r
146 - "\t\tfollowing syntax would specify a date range to return messages\n"
\r
147 - "\t\tfrom 2009-10-01 until the current time:\n"
\r
149 - "\t\t\t$(date +%%s -d 2009-10-01)..$(date +%%s)\n\n";
\r
150 + "\t\tThe parser will fill in bits in the enddate from context if\n"
\r
151 + "\t\tleft out, e.g. a 'date:2004..01' will find from 2004-01-01\n"
\r
152 + "\t\tthrough 2004-01-31\n"
\r
155 command_t commands[] = {
\r
156 { "setup", notmuch_setup_command,
\r