--- /dev/null
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 66F8D431FB6\r
+ for <notmuch@notmuchmail.org>; Tue, 7 Oct 2014 04:16:34 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id 6VjD0XZW7lZR for <notmuch@notmuchmail.org>;\r
+ Tue, 7 Oct 2014 04:16:28 -0700 (PDT)\r
+Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com\r
+ [209.85.212.182]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 08544431FAF\r
+ for <notmuch@notmuchmail.org>; Tue, 7 Oct 2014 04:16:27 -0700 (PDT)\r
+Received: by mail-wi0-f182.google.com with SMTP id n3so7510324wiv.3\r
+ for <notmuch@notmuchmail.org>; Tue, 07 Oct 2014 04:16:25 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:subject:in-reply-to:references\r
+ :user-agent:date:message-id:mime-version:content-type\r
+ :content-transfer-encoding;\r
+ bh=kBbQzoymrs8Q1WTEpz4x5mNi2WR4b2hIPLz+skP7dc8=;\r
+ b=CP0sk+sNyyKNstbR/7F9Iw6UfyqJvRxAQctZGjvNes3fLpa/Yqd7ITNz9xq+fAD93H\r
+ ZU/EoXGwRdfzz7QDcbFVAiq4B2VboUJuPC5L4ldQOC08MbTBufBm5LiqXybPdDlNaXXk\r
+ CI1CgpVQdW8AiyTTwShhYbeapj/oYG60Ltm07/r+218NHCpqkZeIWgnXo/qtQsP+FvpE\r
+ P013u9+H56rswLUaknqzqc/3zh+WV35XB/wDUXxG9D0ZfUjqHa79K7Woeca58asL9wEB\r
+ HjCQSf7QqqA/edOpW2rTBZLd6JdGiOsK8NMeHxzuytXlpEJ3CG+iMoNyAZWnrZri2ZGA\r
+ rBkQ==\r
+X-Gm-Message-State:\r
+ ALoCoQloji/JJSW5ig0F91RqvKkFrAQ3UfEkom4TaoMyTBnQATr0opF7RDWZb4d4i+dAG1o49Ezz\r
+X-Received: by 10.181.29.134 with SMTP id jw6mr3704938wid.69.1412680584516;\r
+ Tue, 07 Oct 2014 04:16:24 -0700 (PDT)\r
+Received: from localhost ([2001:4b98:dc0:43:216:3eff:fe1b:25f3])\r
+ by mx.google.com with ESMTPSA id\r
+ bi7sm14330278wib.17.2014.10.07.04.16.23 for <multiple recipients>\r
+ (version=TLSv1.1 cipher=RC4-SHA bits=128/128);\r
+ Tue, 07 Oct 2014 04:16:24 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: sshilovsky@gmail.com, notmuch@notmuchmail.org\r
+Subject: Re: Backward scrolling notmuch_messages_t and notmuch_threads_t\r
+In-Reply-To:\r
+ <CAHc2pO2_mQZzG7TqntSLEY78YEZSVEwDSesgpCn1ZbngJvM0dQ@mail.gmail.com>\r
+References:\r
+ <CAHc2pO2_mQZzG7TqntSLEY78YEZSVEwDSesgpCn1ZbngJvM0dQ@mail.gmail.com>\r
+User-Agent: Notmuch/0.18.1+69~gf92342c (http://notmuchmail.org) Emacs/23.2.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Tue, 07 Oct 2014 13:16:41 +0200\r
+Message-ID: <87lhos5duu.fsf@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Transfer-Encoding: quoted-printable\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 07 Oct 2014 11:16:34 -0000\r
+\r
+On Tue, 07 Oct 2014, Sergei Shilovsky <sshilovsky@gmail.com> wrote:\r
+> Lets consider messages first.\r
+>\r
+> As far as I get there is no straightforward\r
+> notmuch_messages_move_to_previous. One can usually implement such\r
+> behaviour with caching previous messages which is slightly inefficient\r
+> in memory consumption terms.\r
+>\r
+> But we can sort messages either date asc or date desc.\r
+>\r
+> Suppose, we're currently at the 1000th message in query "tag:whatever".\r
+>\r
+> So if we need to go to the previous message we could do something like\r
+>\r
+> notmuch search --sort=3Doldest-first tag:whatever and \\r
+> date:..<here is the date of the 1000th message>\r
+>\r
+> This query's result should start with our 1000th message following its\r
+> previous message (in terms of the original request). So backward\r
+> scrolling with no cache looks to be at least possible.\r
+>\r
+> Any idea of would that be fine? Is it possible to implement similar\r
+> thing at low-level?\r
+\r
+See notmuch search --offset=3DN and --limit=3DN options.\r
+\r
+BR,\r
+Jani.\r
+\r
+\r
+>\r
+> --=20\r
+> =D0=A1 =D1=83=D0=B2=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=D0=BC,\r
+> =D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9 =D0=A8=D0=B8=D0=BB=D0=BE=D0=B2=D1=81=\r
+=D0=BA=D0=B8=D0=B9\r
+> Sergei Shilovsky\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r