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 A25DA431FBC for ; Fri, 22 Jan 2010 07:33:17 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0.107 X-Spam-Level: X-Spam-Status: No, score=0.107 tagged_above=-999 required=5 tests=[AWL=0.106, BAYES_50=0.001] autolearn=ham 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 A96G5dMqg093 for ; Fri, 22 Jan 2010 07:33:17 -0800 (PST) Received: from homiemail-a25.g.dreamhost.com (caiajhbdcaib.dreamhost.com [208.97.132.81]) by olra.theworths.org (Postfix) with ESMTP id 1321D431FAE for ; Fri, 22 Jan 2010 07:33:17 -0800 (PST) Received: from sspaeth.de (unknown [84.55.198.58]) by homiemail-a25.g.dreamhost.com (Postfix) with ESMTPA id 246AC678071; Fri, 22 Jan 2010 07:33:14 -0800 (PST) Received: by sspaeth.de (sSMTP sendmail emulation); Fri, 22 Jan 2010 16:33:12 +0100 From: "Sebastian Spaeth" To: notmuch@notmuchmail.org In-Reply-To: <1264173971-11879-1-git-send-email-Sebastian@SSpaeth.de> References: <1264173971-11879-1-git-send-email-Sebastian@SSpaeth.de> Date: Fri, 22 Jan 2010 16:33:12 +0100 Message-ID: <87ockmjgsn.fsf@SSpaeth.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [notmuch] [PATCH] Make the date parser nicer 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: Fri, 22 Jan 2010 15:33:17 -0000 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 of 2001 until end of 2010) ... date:20011201..200506 (from 1001-12-01 until 2005-06-31 The code will pretty surely need some cleaning up, as I can hardly code C, not to speak of C++. But at least it works and it is not very intrusive. (Ps. now that I think of it, I always use day 31 as last day, which is surely wrong, it also still accepts some obviously wrong dates like 20040231) We could also think about using a xapian DateValueRangeParser to do that, but that would require saving the timestamp as YYYYMMDD in the database (which we probably do not want). Feedback welcome, Sebastian