[notmuch] [PATCH] Make the date parser nicer

2010-01-27 Thread Sebastian Spaeth
On Tue, 26 Jan 2010 09:55:00 -0800, Keith Packard wrote: > Very cool. Oh, if you've got commits that don't compile on their own, > you should squash them together (or fix it in some other way). Makes > bisecting easier in the future. Makes sense. I am still quite new to git, so excuse those

Re: [notmuch] [PATCH] Make the date parser nicer

2010-01-27 Thread Sebastian Spaeth
On Tue, 26 Jan 2010 09:55:00 -0800, Keith Packard kei...@keithp.com wrote: Very cool. Oh, if you've got commits that don't compile on their own, you should squash them together (or fix it in some other way). Makes bisecting easier in the future. Makes sense. I am still quite new to git, so

[notmuch] [PATCH] Make the date parser nicer

2010-01-26 Thread Sebastian Spaeth
On Mon, 25 Jan 2010 22:36:35 -0800, Keith Packard wrote: > Here's some code which further improves date parsing by allowing lots of > date formats, including things like "today", "thisweek", ISO and US date > formats and month names. You can separate two dates with .. to make a > range, or you

[notmuch] [PATCH] Make the date parser nicer

2010-01-26 Thread Sebastian Spaeth
On Mon, 25 Jan 2010 22:36:35 -0800, Keith Packard wrote: > Here's some code which further improves date parsing by allowing lots of > date formats, including things like "today", "thisweek", ISO and US date > formats and month names. You can separate two dates with .. to make a > range, or you

[notmuch] [PATCH] Make the date parser nicer

2010-01-26 Thread Keith Packard
On Tue, 26 Jan 2010 12:50:41 +0100, "Sebastian Spaeth" wrote: > On Mon, 25 Jan 2010 22:36:35 -0800, Keith Packard > wrote: > > Here's some code which further improves date parsing by allowing lots of > > date formats, including things like "today", "thisweek", ISO and US date > > formats and

Re: [notmuch] [PATCH] Make the date parser nicer

2010-01-26 Thread Sebastian Spaeth
On Mon, 25 Jan 2010 22:36:35 -0800, Keith Packard kei...@keithp.com wrote: Here's some code which further improves date parsing by allowing lots of date formats, including things like today, thisweek, ISO and US date formats and month names. You can separate two dates with .. to make a range,

Re: [notmuch] [PATCH] Make the date parser nicer

2010-01-26 Thread Sebastian Spaeth
On Mon, 25 Jan 2010 22:36:35 -0800, Keith Packard kei...@keithp.com wrote: Here's some code which further improves date parsing by allowing lots of date formats, including things like today, thisweek, ISO and US date formats and month names. You can separate two dates with .. to make a range,

Re: [notmuch] [PATCH] Make the date parser nicer

2010-01-26 Thread Keith Packard
On Tue, 26 Jan 2010 12:50:41 +0100, Sebastian Spaeth sebast...@sspaeth.de wrote: On Mon, 25 Jan 2010 22:36:35 -0800, Keith Packard kei...@keithp.com wrote: Here's some code which further improves date parsing by allowing lots of date formats, including things like today, thisweek, ISO and US

[notmuch] [PATCH] Make the date parser nicer

2010-01-25 Thread Keith Packard
On Fri, 22 Jan 2010 16:26:11 +0100, Sebastian Spaeth wrote: > Currently we have to enter mail dates as timestamps. This approach > does 2 things: it requires the prefix 'date:' and it allows timestamps > to be specified as , MM or MMDD. So a notmuch show > date:2005..20060512 will

[notmuch] [PATCH] Make the date parser nicer (v3 + 'now' keyword) (final mail)

2010-01-25 Thread Sebastian Spaeth
Sorry, very last mail from me on this issue. I squashed the patches into 3 distinct ones, and inherited a tree from cworth's master tree for easier pulling (rather than basing it off my all-features branch). This branch is here: http://github.com/spaetz/notmuch-all-feature/commits/dateparser2

[notmuch] [PATCH] Make the date parser nicer (v3 + 'now' keyword)

2010-01-25 Thread Sebastian Spaeth
The patch previously sent can be considered my final attempt to a nicer date parser. In addition to some testing, I have updated the documentation to reflect the new syntax, and I have also added the keyword 'now' as a possibility. So 'date:2002..now' (all mails from 2002 until now) or

[notmuch] [PATCH] Make the date parser nicer. This is v3 and considered to be final (but the documentation).

2010-01-25 Thread Sebastian Spaeth
Currently we have to enter mail dates as timestamps. This approach does 2 things: 1) it requires the prefix 'date:' 2) it allows dates to be specified in a flexible way. So a notmuch show date:2005..2006-05-12 will find all mails from 2005-01-01 until 2006-05-12. Possible time formats:

[notmuch] [PATCH] Make the date parser nicer. This is v3 and considered to be final (but the documentation).

2010-01-25 Thread Sebastian Spaeth
Currently we have to enter mail dates as timestamps. This approach does 2 things: 1) it requires the prefix 'date:' 2) it allows dates to be specified in a flexible way. So a notmuch show date:2005..2006-05-12 will find all mails from 2005-01-01 until 2006-05-12. Possible time formats:

Re: [notmuch] [PATCH] Make the date parser nicer (v3 + 'now' keyword)

2010-01-25 Thread Sebastian Spaeth
The patch previously sent can be considered my final attempt to a nicer date parser. In addition to some testing, I have updated the documentation to reflect the new syntax, and I have also added the keyword 'now' as a possibility. So 'date:2002..now' (all mails from 2002 until now) or

Re: [notmuch] [PATCH] Make the date parser nicer (v3 + 'now' keyword) (final mail)

2010-01-25 Thread Sebastian Spaeth
Sorry, very last mail from me on this issue. I squashed the patches into 3 distinct ones, and inherited a tree from cworth's master tree for easier pulling (rather than basing it off my all-features branch). This branch is here: http://github.com/spaetz/notmuch-all-feature/commits/dateparser2

[notmuch] [PATCH] Make the date parser nicer

2010-01-24 Thread Sebastian Spaeth
Currently we have to enter mail dates as timestamps. This approach does 2 things: 1) it requires the prefix 'date:' 2) it allows dates to be specified in some formats. So a notmuch show date:2005..2006-05-12 will find all mails from 2005-01-01 until 2006-05-12. The code is probably not in a

[notmuch] [PATCH] Make the date parser nicer

2010-01-22 Thread Sebastian Spaeth
On Fri, 22 Jan 2010 16:26:11 +0100, Sebastian Spaeth wrot> + if (begin.size() == 8) { > + int no_items; > + no_items = sscanf(begin.c_str(), "%4i%2i%2i", , , ); > + if (no_items != 3) > + return Xapian::BAD_VALUENO; Also I have found that my sscanf skills are sourly

[notmuch] [PATCH] Make the date parser nicer

2010-01-22 Thread Sebastian Spaeth
Please find in the previous mail attached my patch (against my current all-feature branch, but should pretty much apply to current master too). It is a proof-of-concept to make the date parser nicer. The following searches work with this code: notmuch show... ... date:2001..2010 (from beginning

[notmuch] [PATCH] Make the date parser nicer

2010-01-22 Thread Sebastian Spaeth
Currently we have to enter mail dates as timestamps. This approach does 2 things: it requires the prefix 'date:' and it allows timestamps to be specified as , MM or MMDD. So a notmuch show date:2005..20060512 will find all mails from 2005-01-01 until 2006-05-12. The code is probably

[notmuch] [PATCH] Make the date parser nicer

2010-01-22 Thread Sebastian Spaeth
Currently we have to enter mail dates as timestamps. This approach does 2 things: it requires the prefix 'date:' and it allows timestamps to be specified as , MM or MMDD. So a notmuch show date:2005..20060512 will find all mails from 2005-01-01 until 2006-05-12. The code is probably

Re: [notmuch] [PATCH] Make the date parser nicer

2010-01-22 Thread Sebastian Spaeth
Please find in the previous mail attached my patch (against my current all-feature branch, but should pretty much apply to current master too). It is a proof-of-concept to make the date parser nicer. The following searches work with this code: notmuch show... ... date:2001..2010 (from beginning