From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 24A6A431FAF for ; Mon, 17 Sep 2012 08:04:10 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7] 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 HXHwyGqusHUP for ; Mon, 17 Sep 2012 08:04:09 -0700 (PDT) Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 289E1431FAE for ; Mon, 17 Sep 2012 08:04:09 -0700 (PDT) Received: by bkwj4 with SMTP id j4so2816031bkw.26 for ; Mon, 17 Sep 2012 08:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:subject:in-reply-to:organization:references :user-agent:x-face:face:x-pgp:x-pgp-fp:date:message-id:mime-version :content-type; bh=beOaq9JitZSXqsYTLVeP32d2cR0nGxuMA8AAYGcID3E=; b=dl4RLjOs34wxMwFO9BAUvhW6BzCX+XWeqBIq+mbBmVoAcyEVFu9wzCQqmrcY1to7xZ I8SZb4DzXJ2ZG+7VHOEkNMxFFxcsaaze9jfQDsQzkoJqu5WpNiXRYx44FZUZ31sK7OSL wBds+3k13L3UArYqie+Gh0kCg4eNOFl1dYUshp/H8Lx4/4yGom2Jw4mSF8DKv4JvKQFh jMEvocysEwMmys7HHT748QHbFpF8Hafei9M8IxeUob3jphrqctKLEONrtsNBJX3sjkPu Zoq0SzeKwP7pcSFR28/HDvVOHqnfNIIgYv9GEEoQNbexAKtquVWqQLJ25cr3425QYwUr vqLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:subject:in-reply-to:organization:references :user-agent:x-face:face:x-pgp:x-pgp-fp:date:message-id:mime-version :content-type:x-gm-message-state; bh=beOaq9JitZSXqsYTLVeP32d2cR0nGxuMA8AAYGcID3E=; b=m+MlgscYCYe6/4L04hHzXLLa2rp7hcJYbblrgM5sQhwx1J0OwdYKGgnUIuFIS5qdPd vFft/7s1luO0axmFyI2vOuPhfg7btZyqTtcF8AtyiL1xOYTIsq23HveoKZ5AUyqf8ky3 BwmNmmkm8BlExjUdxsOuThpPO2KhPRClcPa5HoqrmvBJg9ipEKGmnAmtY84gpAi7eXZK J0rDltf7Htmnna3ghZQITtKhzQCbqpOcLZ8qjpqIqDs6xQ1giiS6Had21KQt6q3X1W6o EJnjBhr3qDZhJ/Cft/1r7pNPZtWzK092AqGPaxipHQTkR8UTUyLVP6So81xlKKbMmRPY q9SQ== Received: by 10.204.130.87 with SMTP id r23mr4585352bks.123.1347894247701; Mon, 17 Sep 2012 08:04:07 -0700 (PDT) Received: by 10.204.130.87 with SMTP id r23mr4585331bks.123.1347894247415; Mon, 17 Sep 2012 08:04:07 -0700 (PDT) Received: from mpn-glaptop ([172.28.91.186]) by mx.google.com with ESMTPS id y20sm5784145bkv.11.2012.09.17.08.04.05 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Sep 2012 08:04:06 -0700 (PDT) Sender: Michal Nazarewicz From: Michal Nazarewicz To: David Bremner , Jani Nikula , notmuch@notmuchmail.org Subject: Re: [PATCH v3 6/9] lib: add date range query support In-Reply-To: <878vce5cip.fsf@zancas.localnet> Organization: http://mina86.com/ References: <532340d05ea748518c021048900bb83149e04e88.1347484177.git.jani@nikula.org> <878vce5cip.fsf@zancas.localnet> User-Agent: Notmuch/0.14+22~g8bdc16b (http://notmuchmail.org) Emacs/24.2.50.1 (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2t01AoEjRbs0sYugp14/4X5n4pU4EHHnMAAAAAElFTkSuQmCC X-PGP: 50751FF4 X-PGP-FP: AC1F 5F5C D418 88F8 CC84 5858 2060 4012 5075 1FF4 Date: Mon, 17 Sep 2012 17:03:59 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Gm-Message-State: ALoCoQnryQVY1cjh8LiOxgo8fDLwENrdjqCmMzowlF9uk/zkPGQyPXMHZ47MXley4FfmWpzZRKwD+6bbhdiU5HvmUzl2hDYXwVQhYOSp4tGElMSPXoz+HeIgrw6hewWUow7bKxfkifA15WnbWXu+u+PhiyQDceRVmBiEYiwFHT6RkYleBpby/5vO1uHgNIw3d65skbildgODeWaYvlQ/GErDAZeZsiGMuw== 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, 17 Sep 2012 15:04:10 -0000 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > Michal Nazarewicz writes: >> IMO this is totally unintuitive and not how the range should work. >> date:foo..bar should return messages whose date >=3D foo and < bar. So >> for instance date:november..yesterday should return messages whose date >> is > 2012/11/01 00:00:00 and < 2012/09/12 00:00:00. So to get >> yesterdays messages one would do: date:yesterday..today. On Thu, Sep 13 2012, David Bremner wrote: > I don't find ranges being half-open by default to be very > intuitive. Perhaps I don't program in python enough. Perhaps C than: =E2=80=9Cfor (i =3D 0; i < 10; ++i)=E2=80=9D is the standar= d idiom and the end range is open. Let's take a look at: date:2012/01/01..2012/01/01 + 1 day in my opinion, that should give results from the first of January only, since =E2=80=9C+ 1 day=E2=80=9D indicates in a way how long user want the p= eriod to be. I think it's also easier to pragmatically create ranges. For instance, let's say you want to create ranges for each week, you'd end up with: date:2012/01/02..2012/01/09 ## 2012w01 date:2012/01/09..2012/01/16 ## 2012w02 date:2012/01/16..2012/01/23 ## 2012w03 Notice how the opening date of a range matches the closing date of the previous date. --=20 Best regards, _ _ .o. | Liege of Serenely Enlightened Majesty of o' \,=3D./ `o ..o | Computer Science, Micha=C5=82 =E2=80=9Cmina86=E2=80=9D Nazarewicz = (o o) ooo +------------------ooO--(_)--Ooo-- --=-=-= Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --==-=-= Content-Type: text/plain --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAEBAgAGBQJQVzvfAAoJECBgQBJQdR/0LR8P/1HMwzVXjwp1rbOkWSPSFqoE 6s3aGOzcVVEyDaWU5byJNYHoO0WP1D5YduXcbIKMoCNFvsVQEGrGPv3Ao8FtHu8U /xBkrUU+Tv7joazrDQPaWum4HoOULlRrDOQZiaFuuSyrXCSsH6b/uxLaVCg7edAB KaZK7zHVEbfbbm51S5mpM18Kx2HBx6zfirdKCZOPU/xtYDG97oeS+ejzWJ6+yZO9 jg4KFDqdk51hwW94Ql/mkEizuyAxkk5G+P3pWBoVXWk6tmQ6orNQoyxqh3fzjPJD A8gj+6Zv2nBj9pK7cTo/JqnqRtKkAZihg5Qw7Od293M45NLnCi+TWl+/UtORBbul 2g2wd9wd4NLe/DZtSit8BWGzDbb1s5P6uY0O02iG04oXDHmy24BNipGD6TBfEDLh anj1aO0ieZTEo24IG/0pr/U/25954ShN39+k+QewaXmWYWrSKe6WWX8mPz6/7D7F 4oox0pfm4XegNDjfLqByihJXeqq4Q0gwfZEBHX4t3WJhc+SGDO/08kzTbsrGyG64 4z87CU/VnMI54MOOCwkUn0/gLqTXmpCTXbDv+XHvtDISVxiX8JlDqdlHXzEaocAB xZ3Y9VNE1cG7WuP4sw3+tOUwIyOa5lRf6/OEyDOXtDwjdsYhDc0NnPY873Brbrvf om5CZdUg+MGuyTgZqCo5 =W5eY -----END PGP SIGNATURE----- --==-=-=-- --=-=-=--