1 Return-Path: <sshilovsky@gmail.com>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 0A0DE431FB6
\r
6 for <notmuch@notmuchmail.org>; Tue, 7 Oct 2014 07:04:18 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id EKLn6RV07Tl9 for <notmuch@notmuchmail.org>;
\r
17 Tue, 7 Oct 2014 07:04:10 -0700 (PDT)
\r
18 Received: from mail-oi0-f52.google.com (mail-oi0-f52.google.com
\r
19 [209.85.218.52]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id B42D0431FAF
\r
22 for <notmuch@notmuchmail.org>; Tue, 7 Oct 2014 07:04:10 -0700 (PDT)
\r
23 Received: by mail-oi0-f52.google.com with SMTP id a3so5217253oib.11
\r
24 for <notmuch@notmuchmail.org>; Tue, 07 Oct 2014 07:04:10 -0700 (PDT)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
26 h=mime-version:reply-to:in-reply-to:references:date:message-id
\r
27 :subject:from:to:cc:content-type:content-transfer-encoding;
\r
28 bh=+AatGbCyyrCfWm9m+zgIozJNs8d4k+V0mYYoJ/LrpbQ=;
\r
29 b=NV5G8ugAvX7FTLUZ25Q2P6OtWV3VwHPFKZs8Q18h65hW2EvF1Kyc6zOPpTUo8r7d/L
\r
30 aVjWWcSmlQEZUKTy3MZr0MRfLhmm7UKv1HiPyx4JzhYhfmDECblA/ypE2O/1/dPLPxiK
\r
31 QAsUJ27QqRmx09gK56WbUVdh0+bSI+SHONYKx41m33/df7Oo0Swdwdg19uG93oFb7F2d
\r
32 h5eAWdyEfl4VXJUf4T7R99pNrIj6jzCrlHfiB+iGZixZa75mNNy6yZtsgRDO6kirb0IU
\r
33 r/vTZc9izeUDvCwkWakYfTfvrLy2PJnhEOv6+5MDqS/WXajyNf6pCHs6/dBz8ted3NLB
\r
36 X-Received: by 10.182.236.65 with SMTP id us1mr4373287obc.38.1412690649854;
\r
37 Tue, 07 Oct 2014 07:04:09 -0700 (PDT)
\r
38 Received: by 10.76.41.3 with HTTP; Tue, 7 Oct 2014 07:04:09 -0700 (PDT)
\r
39 In-Reply-To: <87lhos5duu.fsf@nikula.org>
\r
41 <CAHc2pO2_mQZzG7TqntSLEY78YEZSVEwDSesgpCn1ZbngJvM0dQ@mail.gmail.com>
\r
42 <87lhos5duu.fsf@nikula.org>
\r
43 Date: Tue, 7 Oct 2014 18:04:09 +0400
\r
45 <CAHc2pO2J6-UMVnLx3dSGns1z4aaxSZZdGfVNVtetcex9xbsCKQ@mail.gmail.com>
\r
46 Subject: Re: Backward scrolling notmuch_messages_t and notmuch_threads_t
\r
47 From: Sergei Shilovsky <sshilovsky@gmail.com>
\r
48 To: Jani Nikula <jani@nikula.org>
\r
49 Content-Type: text/plain; charset=UTF-8
\r
50 Content-Transfer-Encoding: quoted-printable
\r
51 Cc: notmuch@notmuchmail.org
\r
52 X-BeenThere: notmuch@notmuchmail.org
\r
53 X-Mailman-Version: 2.1.13
\r
55 Reply-To: sshilovsky@gmail.com
\r
56 List-Id: "Use and development of the notmuch mail system."
\r
57 <notmuch.notmuchmail.org>
\r
58 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
59 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
60 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
61 List-Post: <mailto:notmuch@notmuchmail.org>
\r
62 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
63 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
64 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
65 X-List-Received-Date: Tue, 07 Oct 2014 14:04:18 -0000
\r
67 notmuch search --offset` simply skips the number of threads/messages.
\r
68 This is not so fast if the offset is large.
\r
71 99 notmuch_threads_valid (threads) && (limit < 0 || i <
\r
73 100 notmuch_threads_move_to_next (threads), i++)
\r
75 102 thread =3D notmuch_threads_get (threads);
\r
77 104 if (i < offset) {
\r
78 105 notmuch_thread_destroy (thread);
\r
82 On Tue, Oct 7, 2014 at 3:16 PM, Jani Nikula <jani@nikula.org> wrote:
\r
83 > On Tue, 07 Oct 2014, Sergei Shilovsky <sshilovsky@gmail.com> wrote:
\r
84 >> Lets consider messages first.
\r
86 >> As far as I get there is no straightforward
\r
87 >> notmuch_messages_move_to_previous. One can usually implement such
\r
88 >> behaviour with caching previous messages which is slightly inefficient
\r
89 >> in memory consumption terms.
\r
91 >> But we can sort messages either date asc or date desc.
\r
93 >> Suppose, we're currently at the 1000th message in query "tag:whatever".
\r
95 >> So if we need to go to the previous message we could do something like
\r
97 >> notmuch search --sort=3Doldest-first tag:whatever and \
\r
98 >> date:..<here is the date of the 1000th message>
\r
100 >> This query's result should start with our 1000th message following its
\r
101 >> previous message (in terms of the original request). So backward
\r
102 >> scrolling with no cache looks to be at least possible.
\r
104 >> Any idea of would that be fine? Is it possible to implement similar
\r
105 >> thing at low-level?
\r
107 > See notmuch search --offset=3DN and --limit=3DN options.
\r
115 >> =D0=A1 =D1=83=D0=B2=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=D0=BC,
\r
116 >> =D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9 =D0=A8=D0=B8=D0=BB=D0=BE=D0=B2=D1=
\r
117 =81=D0=BA=D0=B8=D0=B9
\r
118 >> Sergei Shilovsky
\r
119 >> _______________________________________________
\r
120 >> notmuch mailing list
\r
121 >> notmuch@notmuchmail.org
\r
122 >> http://notmuchmail.org/mailman/listinfo/notmuch
\r
127 =D0=A1 =D1=83=D0=B2=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=D0=BC,
\r
128 =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