unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 0/4] Versatile date/time parser
@ 2011-01-23 11:47 Michal Sojka
  2011-01-23 11:47 ` [PATCH 1/4] Import date/time parser from GNU coreutils Michal Sojka
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Michal Sojka @ 2011-01-23 11:47 UTC (permalink / raw)
  To: notmuch

Hi all,

the following patch series brings into notmuch date/time parser stolen
from GNU coreutils. It can be applied on top of custom query parser
patches from Austin Clements.

This is RFC and it not meant for merging.

With these patches you can specify the date/time in many ways such as:
after:"last monday", after:"2 hours ago", etc. There are some
problems, though.

1) The parser is meant for parsing time instant specifications, which
   not convenient for use with before/after prepositions. For example
   after:"last Tuesday" should mean Wednesday, Thursday etc. and
   before:"last Tuesday" should mean Monday, Sunday, etc.

   Currently, "last Tuesday" means "Tuesday 00:00" and therefore,
   after:"last Tuesday" also matches mails sent on Tuesday.

2) "yesterday" means "24 hours ago" and not "yesterday midnight" as I
   would expect.

3) "Tuesday" means the "next Tuesday" instead of the "last Tuesday",
   which is natural in the context of emails (usually, there are no
   mails with future dates).

I think that all these problems could be fixed in the parser, but
maybe some others do not see them as problems or there might be a
better parser available for us to use. What do you think?

In any way, if anybody wants to try it, the whole patch serie (custom
query parser + date parse (without cworth's folder-based search)) is
available from my git repository:

   git pull git://rtime.felk.cvut.cz/notmuch.git date-parser

If we decide to use this parser, we might also want to reduce its
dependencies a bit. Since it is able to run even on DOS, there are
many compatibility functions included.

-Michal   

Michal Sojka (4):
  Import date/time parser from GNU coreutils
  Compile the date/time parser into notmuch library
  Use the time/date parser for after: and before: prefixes
  Add first date parser tests

 Makefile.local      |    3 +
 configure           |    8 +
 lib/Makefile.local  |    5 +-
 lib/c-ctype.c       |  398 ++++++
 lib/c-ctype.h       |  297 +++++
 lib/config.h        |   45 +
 lib/database.cc     |   14 +-
 lib/getdate.c       | 3534 +++++++++++++++++++++++++++++++++++++++++++++++++++
 lib/getdate.h       |   31 +
 lib/getdate.y       | 1609 +++++++++++++++++++++++
 lib/gettime.c       |   48 +
 lib/intprops.h      |   83 ++
 lib/timespec.h      |   39 +
 lib/verify.h        |  140 ++
 test/Makefile.local |    9 +-
 test/basic          |    2 +-
 test/date-parser    |   37 +
 test/notmuch-test   |    2 +-
 18 files changed, 6293 insertions(+), 11 deletions(-)
 create mode 100644 lib/c-ctype.c
 create mode 100644 lib/c-ctype.h
 create mode 100644 lib/config.h
 create mode 100644 lib/getdate.c
 create mode 100644 lib/getdate.h
 create mode 100644 lib/getdate.y
 create mode 100644 lib/gettime.c
 create mode 100644 lib/gettime.h
 create mode 100644 lib/intprops.h
 create mode 100644 lib/timespec.h
 create mode 100644 lib/verify.h
 create mode 100755 test/date-parser

-- 
1.7.2.3

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-02-01  8:36 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-23 11:47 [PATCH 0/4] Versatile date/time parser Michal Sojka
2011-01-23 11:47 ` [PATCH 1/4] Import date/time parser from GNU coreutils Michal Sojka
2011-01-24 21:25   ` Jameson Rollins
2011-01-25  8:41     ` Michal Sojka
2011-01-23 11:47 ` [PATCH 2/4] Compile the date/time parser into notmuch library Michal Sojka
2011-01-23 11:47 ` [PATCH 3/4] Use the time/date parser for after: and before: prefixes Michal Sojka
2011-01-23 11:47 ` [PATCH 4/4] Add first date parser tests Michal Sojka
2011-01-29  4:09 ` [PATCH 0/4] Versatile date/time parser Tom Prince
2011-01-29 18:50   ` Michal Sojka
2011-01-29 19:13     ` Austin Clements
2011-02-01  8:34       ` Michal Sojka
2011-01-29 19:37     ` Sebastian Spaeth
2011-02-01  8:36       ` Michal Sojka

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).