--- /dev/null
+Return-Path: <imain@redhat.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 9F616431FAF\r
+ for <notmuch@notmuchmail.org>; Mon, 6 Oct 2014 10:25:24 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_NONE=-0.0001] 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 gLtGFxy8qEGk for <notmuch@notmuchmail.org>;\r
+ Mon, 6 Oct 2014 10:25:19 -0700 (PDT)\r
+Received: from cmta8.telus.net (cmta8.telus.net [209.171.16.81])\r
+ by olra.theworths.org (Postfix) with ESMTP id F2482431FAE\r
+ for <notmuch@notmuchmail.org>; Mon, 6 Oct 2014 10:25:18 -0700 (PDT)\r
+Received: from ovo.mains.priv ([207.102.88.62]) by cmta8.telus.net with TELUS\r
+ id ztRG1o00U1LiWEf01tRHWi; Mon, 06 Oct 2014 11:25:18 -0600\r
+X-Authority-Analysis: v=2.0 cv=ffdzPTsF c=1 sm=2\r
+ a=EcQDfIwDZEqJA1f7rVUV8Q==:17 a=S-IsBHyFrF4A:10 a=IkcTkHD0fZMA:10\r
+ a=tsa3CZZnAAAA:8 a=iT6l_161Bv_4KwFna24A:9 a=QEXdDO2ut3YA:10\r
+ a=EcQDfIwDZEqJA1f7rVUV8Q==:117\r
+X-Telus-Outbound-IP: 207.102.88.62\r
+Received: from ovo.mains.priv (localhost.localdomain [127.0.0.1])\r
+ by ovo.mains.priv (8.14.8/8.14.8) with ESMTP id s96HPE2k025572\r
+ for <notmuch@notmuchmail.org>; Mon, 6 Oct 2014 10:25:14 -0700\r
+Received: (from imain@localhost)\r
+ by ovo.mains.priv (8.14.8/8.14.8/Submit) id s96HP7bg025555;\r
+ Mon, 6 Oct 2014 10:25:07 -0700\r
+X-Authentication-Warning: ovo.mains.priv: imain set sender to imain@redhat.com\r
+ using -f\r
+Date: Mon, 06 Oct 2014 10:25:07 -0700\r
+From: Ian Main <imain@stemwinder.org>\r
+To: notmuch@notmuchmail.org\r
+Message-ID: <5432d073a9fc2_20301203e8c95@ovo.mains.priv.notmuch>\r
+In-Reply-To: <1412579537-7921-1-git-send-email-imain@stemwinder.org>\r
+References: <1412579537-7921-1-git-send-email-imain@stemwinder.org>\r
+Subject: RE: [PATCH] Improve moving between messages in a thread\r
+Mime-Version: 1.0\r
+Content-Type: text/plain;\r
+ charset=utf-8\r
+Content-Transfer-Encoding: 7bit\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: Mon, 06 Oct 2014 17:25:24 -0000\r
+\r
+Ian Main wrote:\r
+> This patch adds a few changes to moving between threads:\r
+> \r
+> - It supports 'scrolloff' so that if you have this set it will move the\r
+> buffer and cursor so the next/prev email starts at the top of the\r
+> screen.\r
+> - It adds the ability to use shift-tab to go to the previous msg in\r
+> the thread.\r
+> \r
+> Ian\r
+> ---\r
+> vim/notmuch.vim | 24 ++++++++++++++++++++++--\r
+> 1 file changed, 22 insertions(+), 2 deletions(-)\r
+> \r
+> diff --git a/vim/notmuch.vim b/vim/notmuch.vim\r
+> index 331e930..95e5c4b 100644\r
+> --- a/vim/notmuch.vim\r
+> +++ b/vim/notmuch.vim\r
+> @@ -39,6 +39,7 @@ let g:notmuch_show_maps = {\r
+> \ 'p': 'show_save_patches()',\r
+> \ 'r': 'show_reply()',\r
+> \ '?': 'show_info()',\r
+> + \ '<S-Tab>': 'show_prev_msg()',\r
+> \ '<Tab>': 'show_next_msg()',\r
+> \ 'c': 'compose()',\r
+> \ }\r
+> @@ -113,6 +114,23 @@ EOF\r
+> call s:kill_this_buffer()\r
+> endfunction\r
+> \r
+> +function! s:show_prev_msg()\r
+> +ruby << EOF\r
+> + r, c = $curwin.cursor\r
+> + n = $curbuf.line_number\r
+> + i = $messages.index { |m| n >= m.start && n <= m.end }\r
+> + m = $messages[i - 1] if i > 0\r
+> + vim_puts ("messages index is #{i} and m is #{m}")\r
+> + if m\r
+> + r = m.body_start + 1\r
+> + scrolloff = VIM::evaluate("&scrolloff")\r
+> + VIM::command("normal #{m.start + scrolloff}zt")\r
+> + $curwin.cursor = r + scrolloff, c\r
+> + vim_puts("moving to #{m.start + scrolloff}")\r
+\r
+Woops, forgot to remove the vim_puts debugging.\r
+\r
+ Ian\r