Re: [PATCH 1/1] notmuch-mutt: Fix tagging issues
[notmuch-archives.git] / 09 / a58e46a256d5c0d575ae4717fb13d25549c470
1 Return-Path: <bart@jukie.net>\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 82B57431FBC\r
6         for <notmuch@notmuchmail.org>; Fri, 27 Nov 2009 18:32:09 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 Received: from olra.theworths.org ([127.0.0.1])\r
9         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
10         with ESMTP id 2uSyNBCN5lRU for <notmuch@notmuchmail.org>;\r
11         Fri, 27 Nov 2009 18:32:08 -0800 (PST)\r
12 Received: from tau.jukie.net (tau.jukie.net [216.239.93.128])\r
13         by olra.theworths.org (Postfix) with ESMTP id 6EB86431FAE\r
14         for <notmuch@notmuchmail.org>; Fri, 27 Nov 2009 18:32:08 -0800 (PST)\r
15 Received: from localhost.localdomain (oxygen.jukie.net [10.10.10.8])\r
16         by tau.jukie.net (Postfix) with ESMTP id D5856C008F5;\r
17         Fri, 27 Nov 2009 21:32:07 -0500 (EST)\r
18 From: Bart Trojanowski <bart@jukie.net>\r
19 To: notmuch@notmuchmail.org\r
20 Date: Fri, 27 Nov 2009 21:31:12 -0500\r
21 Message-Id: <1259375472-29968-1-git-send-email-bart@jukie.net>\r
22 X-Mailer: git-send-email 1.6.4.4.2.gc2f148\r
23 Cc: Bart Trojanowski <bart@jukie.net>\r
24 Subject: [notmuch] [PATCH] vim: preserve the 'show everything' flag when\r
25         finding next/prev buffer\r
26 X-BeenThere: notmuch@notmuchmail.org\r
27 X-Mailman-Version: 2.1.12\r
28 Precedence: list\r
29 List-Id: "Use and development of the notmuch mail system."\r
30         <notmuch.notmuchmail.org>\r
31 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
32         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
33 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
34 List-Post: <mailto:notmuch@notmuchmail.org>\r
35 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
36 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
37         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
38 X-List-Received-Date: Sat, 28 Nov 2009 02:32:09 -0000\r
39 \r
40 When show mode is invoked it could be displaying just the matched messages\r
41 or everything.  This flag is passed to NM_search_show_thread().  It is then\r
42 stored in a buffer variable, b:nm_show_everything, and used for subsequent\r
43 calls to NM_search_show_thread() triggered by <Space>, <C-n> and <C-p>.\r
44 \r
45 Signed-off-by: Bart Trojanowski <bart@jukie.net>\r
46 ---\r
47  vim/plugin/notmuch.vim |    7 +++++--\r
48  1 files changed, 5 insertions(+), 2 deletions(-)\r
49 \r
50 diff --git a/vim/plugin/notmuch.vim b/vim/plugin/notmuch.vim\r
51 index b415f50..34d70d9 100644\r
52 --- a/vim/plugin/notmuch.vim\r
53 +++ b/vim/plugin/notmuch.vim\r
54 @@ -275,6 +275,7 @@ function! s:NM_search_show_thread(everything)\r
55                  call add(words, ')')\r
56          endif\r
57          call <SID>NM_cmd_show(words)\r
58 +        let b:nm_show_everything = a:everything\r
59  endfunction\r
60  \r
61  function! s:NM_search_prompt()\r
62 @@ -430,6 +431,7 @@ function! s:NM_cmd_show(words)\r
63  endfunction\r
64  \r
65  function! s:NM_show_previous(can_change_thread, find_matching)\r
66 +        let everything = exists('b:nm_show_everything') ? b:nm_show_everything : 0\r
67          let info = b:nm_raw_info\r
68          let lnum = line('.')\r
69          for msg in reverse(copy(info['msgs']))\r
70 @@ -450,7 +452,7 @@ function! s:NM_show_previous(can_change_thread, find_matching)\r
71          call <SID>NM_kill_this_buffer()\r
72          if line('.') > 1\r
73                  norm k\r
74 -                call <SID>NM_search_show_thread()\r
75 +                call <SID>NM_search_show_thread(everything)\r
76                  norm G\r
77                  call <SID>NM_show_previous(0, a:find_matching)\r
78          else\r
79 @@ -479,10 +481,11 @@ function! s:NM_show_next(can_change_thread, find_matching)\r
80  endfunction\r
81  \r
82  function! s:NM_show_next_thread()\r
83 +        let everything = exists('b:nm_show_everything') ? b:nm_show_everything : 0\r
84          call <SID>NM_kill_this_buffer()\r
85          if line('.') != line('$')\r
86                  norm j\r
87 -                call <SID>NM_search_show_thread()\r
88 +                call <SID>NM_search_show_thread(everything)\r
89          else\r
90                  echo 'No more messages.'\r
91          endif\r
92 -- \r
93 1.6.4.4.2.gc2f148\r
94 \r