From: Jani Nikula Date: Thu, 11 Jun 2015 17:24:36 +0000 (+0300) Subject: Re: Syntactic sugar for range syntax X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9159da44f20b73ffbeef8d91013c00b49b89b459;p=notmuch-archives.git Re: Syntactic sugar for range syntax --- diff --git a/ab/72f77ad8c5dacf86fcc2c009b90d7e752a35e9 b/ab/72f77ad8c5dacf86fcc2c009b90d7e752a35e9 new file mode 100644 index 000000000..40e34cafa --- /dev/null +++ b/ab/72f77ad8c5dacf86fcc2c009b90d7e752a35e9 @@ -0,0 +1,133 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id A971B6DE0B29 + for ; Thu, 11 Jun 2015 10:24:39 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: 0.145 +X-Spam-Level: +X-Spam-Status: No, score=0.145 tagged_above=-999 required=5 tests=[AWL=0.865, + RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, + RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 875qLH45_8IU for ; + Thu, 11 Jun 2015 10:24:36 -0700 (PDT) +Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com + [209.85.212.169]) + by arlo.cworth.org (Postfix) with ESMTPS id 8BEB16DE0948 + for ; Thu, 11 Jun 2015 10:24:35 -0700 (PDT) +Received: by wibdq8 with SMTP id dq8so14740848wib.1 + for ; Thu, 11 Jun 2015 10:24:31 -0700 (PDT) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:from:to:subject:in-reply-to:references + :user-agent:date:message-id:mime-version:content-type + :content-transfer-encoding; + bh=gYlgoq/T9/n3eKwEFZYqfvAzKnpmnTRfO5rTfJZ1ieA=; + b=ISndxXEj7UNQjI7+e9VvUdMgEGww28a/rjLn/PTwFK/GTNA3N4+llQlA1eiqkfswZw + mSYsOPiAhCH/qTnwwKnm0er2Dts+SCs0VC1lFIrjnkwZ2uViRyosD0pnBT/WikUui1zR + WfIdkc/KqR3jD5/3db1I5lX46G9v18SIiA6j2h3QAfvipBY3V898fSEY2EZebIEf4XkX + X2b+ZHO+YPCCJC4Jqk3Yq0elU+WF0GgIpghLPZit1a3I4kO4+IIidtwaSKDX+hr5GA0B + QB8U569gvmj7BDUfyXDzO0WENrKAVxCO6rOlCpFYVxhg/y8FDtGa59qMYF2+t0y3hoHS + hEQg== +X-Gm-Message-State: + ALoCoQnG7iURG2k2AWwKU3UqoAV3Uc5fF+0z1JFJvPOf4m4QNq00Z071rETVu+ZciYNYnKPru1q8 +X-Received: by 10.180.76.208 with SMTP id m16mr32288448wiw.39.1434043471582; + Thu, 11 Jun 2015 10:24:31 -0700 (PDT) +Received: from localhost (mobile-access-bcee6b-244.dhcp.inet.fi. + [188.238.107.244]) + by mx.google.com with ESMTPSA id be3sm2582038wib.21.2015.06.11.10.24.29 + (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Thu, 11 Jun 2015 10:24:30 -0700 (PDT) +From: Jani Nikula +To: Robert =?utf-8?Q?K=C3=BCnnemann?= , + notmuch@notmuchmail.org +Subject: Re: Syntactic sugar for range syntax +In-Reply-To: <20150610153833.GA19301@peachum.local> +References: <20150610153833.GA19301@peachum.local> +User-Agent: Notmuch/0.19+86~gbed8b67 (http://notmuchmail.org) Emacs/24.4.1 + (x86_64-pc-linux-gnu) +Date: Thu, 11 Jun 2015 20:24:36 +0300 +Message-ID: <87h9qejgyz.fsf@nikula.org> +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: quoted-printable +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.18 +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: Thu, 11 Jun 2015 17:24:39 -0000 + +On Wed, 10 Jun 2015, Robert K=C3=BCnnemann wrote: +> 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 + +In other words, date:1w.. + +The reference for relative dates is "now" if one is not specified. The +minus sign means nothing, relative dates all refer to the past and are +added together. + +> The following syntactic sugar could shorten this kind of queries: +>=20=20 +> date:r -> date:r..today, if r is a relative date + +You can use open ended queries date:since.. or date:..until to not limit +the end or start time. + +> date:a -> date:a..a, if a is an absolute date + +This needs support from Xapian, but we've discussed this in the past and +agree on the semantics. There's a patch to make date:a..! mean the same +in the mean time: + +http://mid.gmane.org/1425732959-2282-1-git-send-email-jani@nikula.org + +> date:a-r -> date:a-r..a, for combination. + +I think this conflicts with the above. + +> (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:1w.. + +> date:24.12.2014-4w -> date:24.12.2014-4w..24.12.2014=20 +> +> What do you think about this suggestion? Is this something notmuch would +> do, or rather something for xapian? + +What we can do in notmuch is pretty limited unless we write a full blown +custom query parser. Basically Xapian parses date: and .., and passes us +the rest to figure out. + + +HTH, +Jani. + + +> +> With kind regards, Robert K=C3=BCnnemann +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch