Backward scrolling notmuch_messages_t and notmuch_threads_t
authorSergei Shilovsky <sshilovsky@gmail.com>
Tue, 7 Oct 2014 11:00:47 +0000 (15:00 +0400)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:05:08 +0000 (10:05 -0800)
cc/40c4a2f6d6f7676d161c3f6f8155d6206344c2 [new file with mode: 0644]

diff --git a/cc/40c4a2f6d6f7676d161c3f6f8155d6206344c2 b/cc/40c4a2f6d6f7676d161c3f6f8155d6206344c2
new file mode 100644 (file)
index 0000000..f4a973b
--- /dev/null
@@ -0,0 +1,89 @@
+Return-Path: <sshilovsky@gmail.com>\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 156BE431FB6\r
+       for <notmuch@notmuchmail.org>; Tue,  7 Oct 2014 04:00:52 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, 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 friTSaOC8CSI for <notmuch@notmuchmail.org>;\r
+       Tue,  7 Oct 2014 04:00:48 -0700 (PDT)\r
+Received: from mail-oi0-f51.google.com (mail-oi0-f51.google.com\r
+       [209.85.218.51]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id AA294431FAF\r
+       for <notmuch@notmuchmail.org>; Tue,  7 Oct 2014 04:00:48 -0700 (PDT)\r
+Received: by mail-oi0-f51.google.com with SMTP id h136so2161387oig.10\r
+       for <notmuch@notmuchmail.org>; Tue, 07 Oct 2014 04:00:47 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=mime-version:reply-to:date:message-id:subject:from:to:content-type\r
+       :content-transfer-encoding;\r
+       bh=LqB8w9rvkWjX4kLN3rLTwjVOYzv6MwfdCXYqhZvFIkg=;\r
+       b=luqqHshEDKqBTBAJPIljHNzZDeKjh0IPiepv9Evh1kpSF8ypiI4nENNwUINNwDIRAi\r
+       hoPME1pM3NciQz+1pep/RP7eK9dNlG3erwI27H4FguzWnmfpRu6pVaG/VvtNQVrJqQI8\r
+       GFnrH0Q2wvPEOmIOLlCIsMgk2uw2YHcG7nRrl43sjAWNeoZI8bPKtpe1Y28UPxNdt+Pr\r
+       IL0SC1+VWT491hD9vsrtfafOtNWfmhe7B/vJQh6q5J2yFAlrGIYH3IQPtjXDO6VShMHW\r
+       xyKiYelQG69dNn+95Zb9Knk2cV5fsRN9DhBkjzQYIP0Sm3xWpTjU52hEc3EQOH9fJyAu\r
+       r9EQ==\r
+MIME-Version: 1.0\r
+X-Received: by 10.182.191.102 with SMTP id gx6mr3013513obc.60.1412679647129;\r
+       Tue, 07 Oct 2014 04:00:47 -0700 (PDT)\r
+Received: by 10.76.41.3 with HTTP; Tue, 7 Oct 2014 04:00:47 -0700 (PDT)\r
+Date: Tue, 7 Oct 2014 15:00:47 +0400\r
+Message-ID:\r
+ <CAHc2pO2_mQZzG7TqntSLEY78YEZSVEwDSesgpCn1ZbngJvM0dQ@mail.gmail.com>\r
+Subject: Backward scrolling notmuch_messages_t and notmuch_threads_t\r
+From: Sergei Shilovsky <sshilovsky@gmail.com>\r
+To: notmuch@notmuchmail.org\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
+Reply-To: sshilovsky@gmail.com\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:00:52 -0000\r
+\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
+--=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