Re: [PATCH v4 02/16] Move crypto.c into libutil
[notmuch-archives.git] / 72 / 927a5ad67f1d92b3c1c97eeee786c8e8707343
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 7901F431FC2\r
6         for <notmuch@notmuchmail.org>; Sat, 25 Feb 2012 20:03:55 -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.804\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.804 tagged_above=-999 required=5\r
12         tests=[DATE_IN_PAST_12_24=0.804] 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 CUI5v-ZRBwcU for <notmuch@notmuchmail.org>;\r
16         Sat, 25 Feb 2012 20:03:54 -0800 (PST)\r
17 Received: from guru.guru-group.fi (guru-group.fi [87.108.86.66])\r
18         by olra.theworths.org (Postfix) with ESMTP id EF084431FBD\r
19         for <notmuch@notmuchmail.org>; Sat, 25 Feb 2012 20:03:53 -0800 (PST)\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)\r
21         id 3BC8168057; Sat, 25 Feb 2012 17:05:44 +0200 (EET)\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>\r
23 To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org\r
24 Subject: Re: [RFC PATCH 0/2] natural language date range search\r
25 In-Reply-To: <cover.1329689945.git.jani@nikula.org>\r
26 References: <cover.1329689945.git.jani@nikula.org>\r
27 User-Agent: Notmuch/0.11.1+225~g90fb4e8 (http://notmuchmail.org) Emacs/23.3.1\r
28         (x86_64-unknown-linux-gnu)\r
29 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
30         $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
31         !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
32 Date: Sat, 25 Feb 2012 17:05:44 +0200\r
33 Message-ID: <m2mx87j6lz.fsf@guru.guru-group.fi>\r
34 MIME-Version: 1.0\r
35 Content-Type: text/plain; charset=us-ascii\r
36 X-BeenThere: notmuch@notmuchmail.org\r
37 X-Mailman-Version: 2.1.13\r
38 Precedence: list\r
39 List-Id: "Use and development of the notmuch mail system."\r
40         <notmuch.notmuchmail.org>\r
41 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
42         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
43 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
44 List-Post: <mailto:notmuch@notmuchmail.org>\r
45 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
46 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
47         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
48 X-List-Received-Date: Sun, 26 Feb 2012 04:03:55 -0000\r
49 \r
50 On Mon, 20 Feb 2012 00:55:50 +0200, Jani Nikula <jani@nikula.org> wrote:\r
51 > Hi all, these patches add support for natural language date range search\r
52 > of the form date:since..until, where since and until can be fairly free\r
53 > form date/time expressions in English.\r
54\r
55 > Examples:\r
56\r
57 > date:two-days..yesterday (all mail in the two days before today)\r
58 > date:12h.. (all mail since 12 hrs ago)\r
59 > date:november..november (all mail in previous november)\r
60 > date:2011.. (all mail since the beginning of 2011)\r
61 > date:last-week..this-week (all mail over last and current week)\r
62 > date:5/10/2011-12:34:55..10pm_2012-01-14\r
63\r
64 > Plus plenty more and combinations of the above.\r
65 \r
66 Pretty c00l, the above and the code.\r
67 \r
68\r
69 > The repository for the date/time parser with a command line tool is at\r
70 > [1], and there's a README [2] with a bunch of details too.\r
71 \r
72 By seeing the thoughts thrown in IRC there seems to be plenty if things\r
73 to resolve until something like this is going to be available in stock\r
74 notmuch. In the meanwhile I provide some ideas into the soup; maybe\r
75 our collective mind can have some use of this.\r
76 \r
77 \r
78 Q: Could 'date:timestr' be converted to 'date:timestr..timestr' ?\r
79 \r
80 In this idea -<timestr> means relative time and <timestr> absolute\r
81 time. The the time string consists of number and letter and assume\r
82 the above suggestion for date:timestr (<- == date:timestr..timestr)\r
83 Letters are s seconds  h hours  d days  w weeks  m months (more\r
84 useful than for minutes) and  y years.\r
85 \r
86 date:-2000s     email exactly 2000 seconds ago (not very useful)\r
87 date:-2000s..   since 2000 secs in past\r
88 date:..-2000s   up to 2000 secs in past\r
89 \r
90 date:3600s      email with date 01:00 -- today if (local) time is\r
91                 more than 1am. yesterday if less. If there is not\r
92                 mail with date exactly that then no email matches\r
93                 (i.e. same usefullness applies as above)\r
94 date:3600s..    email with date since 01:00 (same today/yesterday\r
95                 resolvation like above)\r
96 \r
97 date:12h..      since noon, either yesterday (time less than 12pm)\r
98                 or today (currently afternoon)\r
99 date:12h        like above, but since 12:00 to 13:00\r
100 date:12h..12h   ditto\r
101 \r
102 date:6pm..      since 18:00 either today (current time > 6pm) or yesterday\r
103 \r
104 date:-12h..     since 12 hours ago\r
105 date:-12h       since 12 hours ago to 11 hours ago\r
106 \r
107 date:-1h        last hour\r
108 date:0h         today 12am - 01am \r
109 \r
110 date:-0d        today\r
111 date:-0d..      ditto\r
112 date:-1d        yesterday\r
113 date:-1d..      yesterday & today\r
114 \r
115 date:-2d        2 days ago\r
116 date:-2d..      day before yesterday, yesterday & today\r
117 \r
118 date:0d         last sunday (if today sunday, today (so being consistent))\r
119 date:1d         last monday (like above)\r
120 date:6d         last saturday (like above)\r
121 date:7d         last sunday (same as 0d)\r
122 \r
123 date:-0w        current week (does week start sun or mon)\r
124 date:-1w        last week (same as above)\r
125 date:-2w..      since beginning of 2 weeks ago\r
126 \r
127 date:1w         (ISO) week number ? current week it this is same week  \r
128                 number. this week last year if current week is less.\r
129 date:1w..       since the above date resolved.\r
130 \r
131 date:11m        last november (m is more useable in month than in minute)\r
132 date:11m..      since last november\r
133 \r
134 date:-11m       whole month 11 months ago\r
135 date:-11m..     since beginning of 11 months ago\r
136 \r
137 date:70y        year 1970\r
138 date:69y        year 2069\r
139 date:0y         year 2000\r
140 date:99y..      since beginning of 1999\r
141 \r
142 date:-0y        this year\r
143 date:-1y        last year\r
144 \r
145 \r
146 This is incomplete, but pretty easy to use format. Letters from English\r
147 language. What is missing letter for month (M?) ar mday (D?). All thought\r
148 as in local time...\r
149 \r
150 ... strings could be concatenated: for example: -3d11h (meaning second\r
151 always absolute). Need to be in granularity order (or something). Timezone\r
152 could be added (pst, utc, eest, z -- and even like -11 or +4\r
153 ( -2y11m+7 meaning year 2010 november in timezone utc + 7 (this year: 2012))\r
154 \r
155 Of course range date:-2d..-5h would be supported.\r
156 \r
157 > BR,\r
158 > Jani.\r
159\r
160\r
161 > [1] https://gitorious.org/parse-time-string/parse-time-string\r
162 > [2] https://gitorious.org/parse-time-string/parse-time-string/blobs/master/README\r
163\r
164 \r
165 Tomi\r
166 \r