Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 64 / bfceca52eb62d8634581e592636ae267f6fc69
1 Return-Path: <telenczuk@unic.cnrs-gif.fr>\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 62C45429E4F\r
6         for <notmuch@notmuchmail.org>; Sat, 10 Jan 2015 04:03:40 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 2.438\r
10 X-Spam-Level: **\r
11 X-Spam-Status: No, score=2.438 tagged_above=-999 required=5\r
12         tests=[DNS_FROM_AHBL_RHSBL=2.438] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id KuOE09vqfUVj for <notmuch@notmuchmail.org>;\r
16         Sat, 10 Jan 2015 04:03:36 -0800 (PST)\r
17 Received: from smtp.webfaction.com (mail6.webfaction.com [74.55.86.74])\r
18         by olra.theworths.org (Postfix) with ESMTP id CD80F429E40\r
19         for <notmuch@notmuchmail.org>; Sat, 10 Jan 2015 04:03:34 -0800 (PST)\r
20 Received: from localhost (87-231-242-54.rev.numericable.fr [87.231.242.54])\r
21         by smtp.webfaction.com (Postfix) with ESMTP id 152C12078836;\r
22         Sat, 10 Jan 2015 12:03:30 +0000 (UTC)\r
23 From: Bartosz <telenczuk@unic.cnrs-gif.fr>\r
24 To: notmuch@notmuchmail.org\r
25 Subject: [PATCH 2/4] VIM: move backward trough messages in thread mode\r
26 Date: Sat, 10 Jan 2015 13:03:02 +0100\r
27 Message-Id: <1420891384-992-3-git-send-email-telenczuk@unic.cnrs-gif.fr>\r
28 X-Mailer: git-send-email 1.9.3 (Apple Git-50)\r
29 In-Reply-To: <1420891384-992-1-git-send-email-telenczuk@unic.cnrs-gif.fr>\r
30 References: <1420891384-992-1-git-send-email-telenczuk@unic.cnrs-gif.fr>\r
31 X-Mailman-Approved-At: Sat, 10 Jan 2015 10:22:24 -0800\r
32 Cc: Bartosz <telenczuk@unic.cnrs-gif.fr>\r
33 X-BeenThere: notmuch@notmuchmail.org\r
34 X-Mailman-Version: 2.1.13\r
35 Precedence: list\r
36 List-Id: "Use and development of the notmuch mail system."\r
37         <notmuch.notmuchmail.org>\r
38 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
39         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
40 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
41 List-Post: <mailto:notmuch@notmuchmail.org>\r
42 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
43 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
45 X-List-Received-Date: Sat, 10 Jan 2015 12:03:40 -0000\r
46 \r
47 ---\r
48  vim/notmuch.vim | 12 ++++++++----\r
49  1 file changed, 8 insertions(+), 4 deletions(-)\r
50 \r
51 diff --git a/vim/notmuch.vim b/vim/notmuch.vim\r
52 index 34d4f92..4f90d79 100644\r
53 --- a/vim/notmuch.vim\r
54 +++ b/vim/notmuch.vim\r
55 @@ -39,7 +39,8 @@ let g:notmuch_show_maps = {\r
56         \ 'p':          'show_save_patches()',\r
57         \ 'r':          'show_reply()',\r
58         \ '?':          'show_info()',\r
59 -       \ '<Tab>':      'show_next_msg()',\r
60 +       \ '<Tab>':      'show_next_msg(1)',\r
61 +       \ '<S-Tab>':    'show_next_msg(-1)',\r
62         \ 'c':          'compose()',\r
63         \ }\r
64  \r
65 @@ -114,15 +115,18 @@ EOF\r
66         call s:kill_this_buffer()\r
67  endfunction\r
68  \r
69 -function! s:show_next_msg()\r
70 +function! s:show_next_msg(inc)\r
71  ruby << EOF\r
72 +       inc = VIM::evaluate('a:inc')\r
73         r, c = $curwin.cursor\r
74         n = $curbuf.line_number\r
75         i = $messages.index { |m| n >= m.start && n <= m.end }\r
76 -       m = $messages[i + 1]\r
77 -       if m\r
78 +       m = $messages[i + inc]\r
79 +       if m and !((i + inc)<0) \r
80                 r = m.body_start + 1\r
81 +               VIM::command("normal zM")\r
82                 VIM::command("normal #{m.start}zt")\r
83 +               VIM::command("normal zo")\r
84                 $curwin.cursor = r, c\r
85         end\r
86  EOF\r
87 -- \r
88 1.9.3 (Apple Git-50)\r
89 \r