Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 831A8431FD0 for ; Wed, 10 Aug 2011 03:23:33 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uvLpzc8fhDlu for ; Wed, 10 Aug 2011 03:23:32 -0700 (PDT) Received: from mail-qw0-f53.google.com (mail-qw0-f53.google.com [209.85.216.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id A3C6F431FB6 for ; Wed, 10 Aug 2011 03:23:32 -0700 (PDT) Received: by qwb7 with SMTP id 7so539114qwb.26 for ; Wed, 10 Aug 2011 03:22:12 -0700 (PDT) Received: by 10.224.31.11 with SMTP id w11mr5474639qac.132.1312971730835; Wed, 10 Aug 2011 03:22:10 -0700 (PDT) Received: from localhost (nikula.org [92.243.24.172]) by mx.google.com with ESMTPS id 1sm716204qcy.7.2011.08.10.03.22.08 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 10 Aug 2011 03:22:09 -0700 (PDT) From: Jani Nikula To: notmuch@notmuchmail.org Subject: [RFC PATCH 0/3] add user friendly date range search Date: Wed, 10 Aug 2011 10:22:04 +0000 Message-Id: X-Mailer: git-send-email 1.7.1 Cc: amdragon@mit.edu X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2011 10:23:33 -0000 Hi, this RFC series adds user friendly date range searches in notmuch. Patches 1 and 2 add the date/time parser from coreutils, and were posted to the list by Michal Sojka in January [1]. I picked them up from the date-parser branch of the git tree at [2]. These worked without modifications, so I didn't touch them. Patch 3 adds the actual date range searches on top of current master. Michal also posted a date search implementation, but it was based on Austin Clements' custom parser patches, which I haven't looked at. Also, this one uses date: range syntax rather than before: and after:, and I think Michal would agree on this one [3]. If the same parser is to be eventually included in notmuch, I'd prefer using the parse-datetime module [3] (get_date() was renamed) directly from gnulib [4], instead of coreutils or elsewhere that just imports from gnulib. Also, I think the gnulib module should be placed in a subdirectory rather than alongside all the notmuch lib files. However there are some complications in using parse-datetime, as gnulib modules heavily rely on autotools. Perhaps one option would be to build a separate library with autotools that has what we need from gnulib? Anyway, this is here now, and works (well, with caveats outlined in the commit message for patch 3) so that people can try this and get a feel of the date range search. I wouldn't put much efforts to cleanly importing gnulib before there's some guarantee that the syntax and semantics are desired in the first place. Personally, I've been happy with it ever since I got used to the semantics of the parser. BR, Jani. [1] http://notmuchmail.org/pipermail/notmuch/2011/003749.html [2] git://rtime.felk.cvut.cz/notmuch.git [3] http://notmuchmail.org/pipermail/notmuch/2011/004096.html [4] http://www.gnu.org/s/gnulib/MODULES.html#module=parse-datetime [3] http://www.gnu.org/s/gnulib/ Jani Nikula (1): lib: add gnulib get_date() based date range search Michal Sojka (2): Import date/time parser from GNU coreutils Compile the date/time parser into notmuch library Makefile.local | 3 + configure | 8 + lib/Makefile.local | 6 +- lib/c-ctype.c | 398 ++++++ lib/c-ctype.h | 297 ++++ lib/config.h | 45 + lib/database-private.h | 1 + lib/database.cc | 4 + lib/getdate-proc.cc | 32 + lib/getdate-proc.h | 21 + lib/getdate.c | 3506 ++++++++++++++++++++++++++++++++++++++++++++++++ lib/getdate.h | 31 + lib/getdate.y | 1581 ++++++++++++++++++++++ lib/gettime.c | 48 + lib/intprops.h | 83 ++ lib/timespec.h | 39 + lib/verify.h | 140 ++ 17 files changed, 6242 insertions(+), 1 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-proc.cc create mode 100644 lib/getdate-proc.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