[notmuch] [PATCH] vim: preserve the 'show everything' flag when finding next/prev...
authorBart Trojanowski <bart@jukie.net>
Sat, 28 Nov 2009 02:31:12 +0000 (21:31 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:35:45 +0000 (09:35 -0800)
09/a58e46a256d5c0d575ae4717fb13d25549c470 [new file with mode: 0644]

diff --git a/09/a58e46a256d5c0d575ae4717fb13d25549c470 b/09/a58e46a256d5c0d575ae4717fb13d25549c470
new file mode 100644 (file)
index 0000000..39499f6
--- /dev/null
@@ -0,0 +1,94 @@
+Return-Path: <bart@jukie.net>\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 82B57431FBC\r
+       for <notmuch@notmuchmail.org>; Fri, 27 Nov 2009 18:32:09 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\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 2uSyNBCN5lRU for <notmuch@notmuchmail.org>;\r
+       Fri, 27 Nov 2009 18:32:08 -0800 (PST)\r
+Received: from tau.jukie.net (tau.jukie.net [216.239.93.128])\r
+       by olra.theworths.org (Postfix) with ESMTP id 6EB86431FAE\r
+       for <notmuch@notmuchmail.org>; Fri, 27 Nov 2009 18:32:08 -0800 (PST)\r
+Received: from localhost.localdomain (oxygen.jukie.net [10.10.10.8])\r
+       by tau.jukie.net (Postfix) with ESMTP id D5856C008F5;\r
+       Fri, 27 Nov 2009 21:32:07 -0500 (EST)\r
+From: Bart Trojanowski <bart@jukie.net>\r
+To: notmuch@notmuchmail.org\r
+Date: Fri, 27 Nov 2009 21:31:12 -0500\r
+Message-Id: <1259375472-29968-1-git-send-email-bart@jukie.net>\r
+X-Mailer: git-send-email 1.6.4.4.2.gc2f148\r
+Cc: Bart Trojanowski <bart@jukie.net>\r
+Subject: [notmuch] [PATCH] vim: preserve the 'show everything' flag when\r
+       finding next/prev buffer\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.12\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: Sat, 28 Nov 2009 02:32:09 -0000\r
+\r
+When show mode is invoked it could be displaying just the matched messages\r
+or everything.  This flag is passed to NM_search_show_thread().  It is then\r
+stored in a buffer variable, b:nm_show_everything, and used for subsequent\r
+calls to NM_search_show_thread() triggered by <Space>, <C-n> and <C-p>.\r
+\r
+Signed-off-by: Bart Trojanowski <bart@jukie.net>\r
+---\r
+ vim/plugin/notmuch.vim |    7 +++++--\r
+ 1 files changed, 5 insertions(+), 2 deletions(-)\r
+\r
+diff --git a/vim/plugin/notmuch.vim b/vim/plugin/notmuch.vim\r
+index b415f50..34d70d9 100644\r
+--- a/vim/plugin/notmuch.vim\r
++++ b/vim/plugin/notmuch.vim\r
+@@ -275,6 +275,7 @@ function! s:NM_search_show_thread(everything)\r
+                 call add(words, ')')\r
+         endif\r
+         call <SID>NM_cmd_show(words)\r
++        let b:nm_show_everything = a:everything\r
+ endfunction\r
\r
+ function! s:NM_search_prompt()\r
+@@ -430,6 +431,7 @@ function! s:NM_cmd_show(words)\r
+ endfunction\r
\r
+ function! s:NM_show_previous(can_change_thread, find_matching)\r
++        let everything = exists('b:nm_show_everything') ? b:nm_show_everything : 0\r
+         let info = b:nm_raw_info\r
+         let lnum = line('.')\r
+         for msg in reverse(copy(info['msgs']))\r
+@@ -450,7 +452,7 @@ function! s:NM_show_previous(can_change_thread, find_matching)\r
+         call <SID>NM_kill_this_buffer()\r
+         if line('.') > 1\r
+                 norm k\r
+-                call <SID>NM_search_show_thread()\r
++                call <SID>NM_search_show_thread(everything)\r
+                 norm G\r
+                 call <SID>NM_show_previous(0, a:find_matching)\r
+         else\r
+@@ -479,10 +481,11 @@ function! s:NM_show_next(can_change_thread, find_matching)\r
+ endfunction\r
\r
+ function! s:NM_show_next_thread()\r
++        let everything = exists('b:nm_show_everything') ? b:nm_show_everything : 0\r
+         call <SID>NM_kill_this_buffer()\r
+         if line('.') != line('$')\r
+                 norm j\r
+-                call <SID>NM_search_show_thread()\r
++                call <SID>NM_search_show_thread(everything)\r
+         else\r
+                 echo 'No more messages.'\r
+         endif\r
+-- \r
+1.6.4.4.2.gc2f148\r
+\r