Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id DB453431FCF for ; Fri, 10 Oct 2014 11:22:09 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_NONE=-0.0001] 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 iwZTgOa6q-az for ; Fri, 10 Oct 2014 11:22:01 -0700 (PDT) Received: from cmta5.telus.net (cmta5.telus.net [209.171.16.78]) by olra.theworths.org (Postfix) with ESMTP id BB4FE431FCB for ; Fri, 10 Oct 2014 11:22:01 -0700 (PDT) Received: from ovo.mains.priv ([207.102.88.62]) by cmta5.telus.net with TELUS id 1WN01p00A1LiWEf01WN08h; Fri, 10 Oct 2014 12:22:01 -0600 X-Authority-Analysis: v=2.0 cv=JvIvWrEC c=1 sm=2 a=EcQDfIwDZEqJA1f7rVUV8Q==:17 a=S-IsBHyFrF4A:10 a=IkcTkHD0fZMA:10 a=tsa3CZZnAAAA:8 a=7343-z1_AAAA:8 a=AqL7Eh603jEDRpnR9qwA:9 a=QEXdDO2ut3YA:10 a=P87eogJZi2UA:10 a=0c-eHkXYtrgA:10 a=EcQDfIwDZEqJA1f7rVUV8Q==:117 X-Telus-Outbound-IP: 207.102.88.62 Received: from ovo.mains.priv (localhost.localdomain [127.0.0.1]) by ovo.mains.priv (8.14.8/8.14.8) with ESMTP id s9AILwbi025236; Fri, 10 Oct 2014 11:21:58 -0700 Received: (from imain@localhost) by ovo.mains.priv (8.14.8/8.14.8/Submit) id s9AILvBL025235; Fri, 10 Oct 2014 11:21:57 -0700 X-Authentication-Warning: ovo.mains.priv: imain set sender to imain@redhat.com using -f Date: Fri, 10 Oct 2014 11:21:57 -0700 From: Ian Main To: Franz Fellner Message-ID: <543823c57b0e9_46ad163fe8863@ovo.mains.priv.notmuch> In-Reply-To: <20141010112122.GB28601@TP_L520.localdomain> References: <1412579537-7921-1-git-send-email-imain@stemwinder.org> <1412618116-27586-1-git-send-email-imain@stemwinder.org> <20141010112122.GB28601@TP_L520.localdomain> Subject: Re: [PATCH] VIM: Improve moving between messages in a thread Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: notmuch@notmuchmail.org 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: Fri, 10 Oct 2014 18:22:10 -0000 Franz Fellner wrote: > Patch works fine for me. It also would be nice to have a "move to next > unread message" function. > Most beautiful would be a treeview of the thread structure. Currently > threads are rendered as plain list, so you can't immediately see and > jump to the quoted mail. Bower IMHO uses the best approach here. I tried > emacs treeview but did not really like it (partly because I failed badly > to implement a solution that shows treeview by default). Indent the > whole large Message view IMHO also is not a good (at least to me) > solution. Yeah I agree. This is a start anyway. As I use the vim client more my plan is to just keep fixing things that get in my way. Thanks for catching the vim_puts. :) Thanks for you're reviews!! Ian > On Mon, 6 Oct 2014 10:55:16 -0700, Ian Main wrote: > > @@ -113,6 +114,22 @@ EOF > > call s:kill_this_buffer() > > endfunction > > > > +function! s:show_prev_msg() > > +ruby << EOF > > + r, c = $curwin.cursor > > + n = $curbuf.line_number > > + i = $messages.index { |m| n >= m.start && n <= m.end } > > + m = $messages[i - 1] if i > 0 > > This one > > + vim_puts ("messages index is #{i} and m is #{m}") > was missed ;) > > > + if m > > + r = m.body_start + 1 > > + scrolloff = VIM::evaluate("&scrolloff") > > + VIM::command("normal #{m.start + scrolloff}zt") > > + $curwin.cursor = r + scrolloff, c > > + end > > +EOF > > +endfunction > > + > > function! s:show_next_msg() > > ruby << EOF > > r, c = $curwin.cursor > > @@ -121,8 +138,9 @@ ruby << EOF > > m = $messages[i + 1] > > if m > > r = m.body_start + 1 > > - VIM::command("normal #{m.start}zt") > > - $curwin.cursor = r, c > > + scrolloff = VIM::evaluate("&scrolloff") > > + VIM::command("normal #{m.start + scrolloff}zt") > > + $curwin.cursor = r + scrolloff, c > > end > > EOF > > endfunction > > -- > > 1.9.3 > > > > _______________________________________________ > > notmuch mailing list > > notmuch@notmuchmail.org > > http://notmuchmail.org/mailman/listinfo/notmuch > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch