Syntactic sugar for range syntax

Subject: Syntactic sugar for range syntax

Date: Wed, 10 Jun 2015 17:38:33 +0200

To: notmuch@notmuchmail.org

Cc:

From: Robert Künnemann


Hi everyone,

I've been using notmuch for about a year now (using mutt-kz) and I am
very happy with it. I have, however, a small suggestion about the range
syntax in search queries. Often, I am looking for emails that have
occurred, say, in the last week. The query has the following form:

 date:today-1week..today

The following syntactic sugar could shorten this kind of queries:
 
 date:r -> date:r..today, if r is a relative date
 date:a -> date:a..a, if a is an absolute date
 date:a-r -> date:a-r..a, for combination.

(If r is interpreted as today-r, the first two transformations are
subsumed by the last.)

For example:
 date:today -> date:today..today
 date:-1week -> date:-1week..today
 date:24.12.2014-4w -> date:24.12.2014-4w..24.12.2014 

What do you think about this suggestion? Is this something notmuch would
do, or rather something for xapian?

With kind regards, Robert Künnemann

Thread: