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 E0C5B431FC7 for ; Mon, 8 Feb 2010 03:14:24 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.746 X-Spam-Level: X-Spam-Status: No, score=-1.746 tagged_above=-999 required=5 tests=[AWL=0.853, BAYES_00=-2.599] 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 08FTNnfUSLki for ; Mon, 8 Feb 2010 03:14:22 -0800 (PST) Received: from homiemail-a11.g.dreamhost.com (caiajhbdcbhh.dreamhost.com [208.97.132.177]) by olra.theworths.org (Postfix) with ESMTP id 4F7F9431FAE for ; Mon, 8 Feb 2010 03:14:19 -0800 (PST) Received: from localhost.localdomain (mtec-hg-docking-1-dhcp-204.ethz.ch [129.132.133.204]) by homiemail-a11.g.dreamhost.com (Postfix) with ESMTPA id 3D80319406D; Mon, 8 Feb 2010 03:14:18 -0800 (PST) From: Sebastian Spaeth To: notmuch@notmuchmail.org Date: Mon, 8 Feb 2010 12:14:12 +0100 Message-Id: <1265627652-25912-4-git-send-email-Sebastian@SSpaeth.de> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1265627652-25912-3-git-send-email-Sebastian@SSpaeth.de> References: <87fx5cjc83.fsf@SSpaeth.de> <1265627652-25912-1-git-send-email-Sebastian@SSpaeth.de> <1265627652-25912-2-git-send-email-Sebastian@SSpaeth.de> <1265627652-25912-3-git-send-email-Sebastian@SSpaeth.de> Subject: [notmuch] [PATCH 4/4] add documentation for the new daterange parser and remove TODO list item 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, 08 Feb 2010 11:14:25 -0000 Signed-off-by: Sebastian Spaeth --- TODO | 9 --------- notmuch.1 | 29 ++++++++++++++++++++--------- notmuch.c | 24 +++++++++++++----------- 3 files changed, 33 insertions(+), 29 deletions(-) diff --git a/TODO b/TODO index bdfe64c..86cbf74 100644 --- a/TODO +++ b/TODO @@ -114,15 +114,6 @@ notmuch library --------------- Index content from citations, please. -Provide a sane syntax for date ranges. First, we don't want to require -both endpoints to be specified. For example it would be nice to be -able to say things like "since:2009-01-1" or "until:2009-01-1" and -have the other endpoint be implicit. Second we'd like to support -relative specifications of time such as "since:'2 months ago'". To do -any of this we're probably going to need to break down an write our -own parser for the query string rather than using Xapian's QueryParser -class. - Make failure to read a file (such as a permissions problem) a warning rather than an error (should be similar to the existing warning for a non-mail file). diff --git a/notmuch.1 b/notmuch.1 index 282ad98..19628f0 100644 --- a/notmuch.1 +++ b/notmuch.1 @@ -413,17 +413,28 @@ expression). Finally, results can be restricted to only messages within a particular time range, (based on the Date: header) with a syntax of: - .. + date:.. -Each timestamp is a number representing the number of seconds since -1970-01-01 00:00:00 UTC. This is not the most convenient means of -expressing date ranges, but until notmuch is fixed to accept a more -convenient form, one can use the date program to construct -timestamps. For example, with the bash shell the folowing syntax would -specify a date range to return messages from 2009-10-01 until the -current time: +A +.B date +can be specified in various formats. It parses the formats in this order and stops if one pattern matches: + + Keywords: +.B today, +.B yesterday, +.B thisweek, +.B lastweek, +.B thismonth, +.B lastmonth. + + Month-day: month[-day]] (month: "January", "Jan", 1) + + ISO format: year[-month[-day]] + + US format : month[/day[/year]] + +The date parser will try to fill in bits in the enddate from context if left out, e.g. a 'date:2004..01' will find from 2004-01-01 through 2004-01-31. - $(date +%s -d 2009-10-01)..$(date +%s) .SH SEE ALSO The emacs-based interface to notmuch (available as .B notmuch.el diff --git a/notmuch.c b/notmuch.c index 87479f8..b8fe01a 100644 --- a/notmuch.c +++ b/notmuch.c @@ -92,19 +92,21 @@ static const char search_terms_help[] = "\t\tmarks around any parenthesized expression).\n" "\n" "\t\tFinally, results can be restricted to only messages within a\n" - "\t\tparticular time range, (based on the Date: header) with:\n" + "\t\tparticular time range, (based on the Date: header) with a\n" + "\t\tsyntax of: date:..\n" "\n" - "\t\t\t..\n" + "\t\tIt can be specified in the following formats, parsing will \n" + "\t\tstop if the first pattern matches:\n" + "\t\tKeywords: 'today','yesterday','thisweek','lastweek',\n" + "\t\t'thismonth', 'lastmonth'. \n" + "\t\tmonth-day : month[-day]] (month: January, Jan, or 1)\n" + "\t\tISO format: year[-month[-day]] (month: January, Jan, or 1)\n" + "\t\tUS format : month[/day[/year]]\n" "\n" - "\t\tEach timestamp is a number representing the number of seconds\n" - "\t\tsince 1970-01-01 00:00:00 UTC. This is not the most convenient\n" - "\t\tmeans of expressing date ranges, but until notmuch is fixed to\n" - "\t\taccept a more convenient form, one can use the date program to\n" - "\t\tconstruct timestamps. For example, with the bash shell the\n" - "\t\tfollowing syntax would specify a date range to return messages\n" - "\t\tfrom 2009-10-01 until the current time:\n" - "\n" - "\t\t\t$(date +%%s -d 2009-10-01)..$(date +%%s)\n\n"; + "\t\tThe parser will fill in bits in the enddate from context if\n" + "\t\tleft out, e.g. a 'date:2004..01' will find from 2004-01-01\n" + "\t\tthrough 2004-01-31\n" + "\n\n"; command_t commands[] = { { "setup", notmuch_setup_command, -- 1.6.3.3