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 995BF429E25 for ; Mon, 15 Aug 2011 02:22:39 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 L5kln7g25Hrg for ; Mon, 15 Aug 2011 02:22:39 -0700 (PDT) Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) by olra.theworths.org (Postfix) with ESMTP id CAA0B431FB6 for ; Mon, 15 Aug 2011 02:22:38 -0700 (PDT) Received: from localhost (unknown [192.168.200.4]) by max.feld.cvut.cz (Postfix) with ESMTP id B2A743CFE75; Mon, 15 Aug 2011 11:22:37 +0200 (CEST) X-Virus-Scanned: IMAP AMAVIS Received: from max.feld.cvut.cz ([192.168.200.1]) by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new, port 10044) with ESMTP id tb4+lsJZbyVU; Mon, 15 Aug 2011 11:22:36 +0200 (CEST) Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by max.feld.cvut.cz (Postfix) with ESMTP id AAEAB3CFE72; Mon, 15 Aug 2011 11:22:36 +0200 (CEST) Received: from steelpick.2x.cz (unknown [141.76.49.12]) (Authenticated sender: sojkam1) by imap.feld.cvut.cz (Postfix) with ESMTPSA id 10993FA003; Mon, 15 Aug 2011 11:22:36 +0200 (CEST) Received: from wsh by steelpick.2x.cz with local (Exim 4.76) (envelope-from ) id 1QstNT-00029v-Tl; Mon, 15 Aug 2011 11:22:35 +0200 From: Michal Sojka To: Jani Nikula , notmuch@notmuchmail.org Subject: Re: [RFC PATCH 0/3] add user friendly date range search In-Reply-To: References: User-Agent: Notmuch/0.6.1-91-g55c2c34 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Mon, 15 Aug 2011 11:22:35 +0200 Message-ID: <87bovryqp0.fsf@steelpick.2x.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Mon, 15 Aug 2011 09:22:39 -0000 Hi Jani, On Wed, 10 Aug 2011, Jani Nikula wrote: > 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]. Sure. > 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? If he include this parser, then we should definitely take it from gunlib. I was not aware of gnulib. But, in the past I thought more about specifying dates in notmuch and came to conclusion, that parse-datetime is probably not the best thing to use for notmuch. The reason is that notmuch users are more interested in date/time ranges than in individual date/times and this module parses only individual date/times. I would simply like notmuch to show all mails from Monday when I say notmuch search date:monday. With parse-datetime approach I would need to say notmuch search date:monday..tuesday or more precisely date:"monday 0:00..tuesday 0:00". I think that this could be implemented by having a parser that works with ranges as primary objects. If user specifies date:range (e.g. date:monday), the meaning would be: since range.start, until range.end If the user specifies date:range1..range2 (e.g. date:monday..wednesday), then the meaning would be: since range1.start, until range2.end And of course, you could also have zero-length ranges to support something like date:12:34:56..13:24:35. I think that this would match most closely the way how I want to search emails by date. Thoughts? Unfortunately, I do not have time to implement this now so volunteers are welcome. -Michal