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 arlo.cworth.org (Postfix) with ESMTP id 8753F6DE0149
\r
6 for <notmuch@notmuchmail.org>; Sat, 18 Apr 2015 01:07:38 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=1.146 tagged_above=-999 required=5 tests=[AWL=0.494,
\r
12 SPF_NEUTRAL=0.652] autolearn=disabled
\r
13 Received: from arlo.cworth.org ([127.0.0.1])
\r
14 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id KqzDHYixxFgi for <notmuch@notmuchmail.org>;
\r
16 Sat, 18 Apr 2015 01:07:36 -0700 (PDT)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by arlo.cworth.org (Postfix) with ESMTP id 216876DE0130
\r
19 for <notmuch@notmuchmail.org>; Sat, 18 Apr 2015 01:07:36 -0700 (PDT)
\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])
\r
21 by guru.guru-group.fi (Postfix) with ESMTP id 2BBDC1000F3;
\r
22 Sat, 18 Apr 2015 11:07:11 +0300 (EEST)
\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
24 To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org
\r
25 Subject: Re: [RFC] lib: add support for date:<query>..! to
\r
26 mean date:<query>..<query>
\r
27 In-Reply-To: <1425732959-2282-1-git-send-email-jani@nikula.org>
\r
28 References: <1425732959-2282-1-git-send-email-jani@nikula.org>
\r
29 User-Agent: Notmuch/0.19+107~gab55bdb (http://notmuchmail.org) Emacs/24.3.1
\r
30 (x86_64-unknown-linux-gnu)
\r
31 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
32 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
33 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
34 Date: Sat, 18 Apr 2015 11:07:10 +0300
\r
35 Message-ID: <m2y4lplv0x.fsf@guru.guru-group.fi>
\r
37 Content-Type: text/plain
\r
38 X-BeenThere: notmuch@notmuchmail.org
\r
39 X-Mailman-Version: 2.1.18
\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, 18 Apr 2015 08:07:38 -0000
\r
52 On Sat, Mar 07 2015, Jani Nikula <jani@nikula.org> wrote:
\r
56 > 1) Is something like this useful at all as an intermediate step before
\r
57 > we can have support for date:<query>? (This can be done with a future
\r
58 > version of Xapian, or with a custom query query parser.)
\r
60 > 2) If yes, are there better alternatives to "!" as the end point? (Or
\r
61 > should the special case be the start point?) Also "@" and "same" have
\r
62 > been suggested. Examples: date:yesterday..! date:today..@
\r
63 > date:@..monday date:january..same.
\r
66 I'd rather see a temporary ugly hack in implementation (to expand
\r
67 date:<date> to date:<date>..<date>) than permanent interface feature.
\r
68 But this looks simple enough... and I'd go just with this implementation
\r
75 > diff --git a/lib/parse-time-vrp.cc b/lib/parse-time-vrp.cc
\r
76 > index 33f07db3410e..03804cf50fa8 100644
\r
77 > --- a/lib/parse-time-vrp.cc
\r
78 > +++ b/lib/parse-time-vrp.cc
\r
79 > @@ -31,6 +31,7 @@ Xapian::valueno
\r
80 > ParseTimeValueRangeProcessor::operator() (std::string &begin, std::string &end)
\r
85 > /* Require date: prefix in start of the range... */
\r
86 > if (STRNCMP_LITERAL (begin.c_str (), PREFIX))
\r
87 > @@ -38,6 +39,7 @@ ParseTimeValueRangeProcessor::operator() (std::string &begin, std::string &end)
\r
89 > /* ...and remove it. */
\r
90 > begin.erase (0, sizeof (PREFIX) - 1);
\r
93 > /* Use the same 'now' for begin and end. */
\r
94 > if (time (&now) == (time_t) -1)
\r
95 > @@ -51,6 +53,9 @@ ParseTimeValueRangeProcessor::operator() (std::string &begin, std::string &end)
\r
98 > if (!end.empty ()) {
\r
99 > + if (end == "!" && ! b.empty ())
\r
102 > if (parse_time_string (end.c_str (), &t, &now, PARSE_TIME_ROUND_UP_INCLUSIVE))
\r
103 > return Xapian::BAD_VALUENO;
\r