From 66adff6ae02fd6d11795f5dac6c07919e8fdada3 Mon Sep 17 00:00:00 2001 From: Ian Main Date: Thu, 2 Oct 2014 12:43:33 +1700 Subject: [PATCH] [PATCH] VIM: Add a 'tag all' folder option. --- 67/1497446c57ddc19da65b6b532868da49fd810b | 85 +++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 67/1497446c57ddc19da65b6b532868da49fd810b diff --git a/67/1497446c57ddc19da65b6b532868da49fd810b b/67/1497446c57ddc19da65b6b532868da49fd810b new file mode 100644 index 000000000..bf3bd5fac --- /dev/null +++ b/67/1497446c57ddc19da65b6b532868da49fd810b @@ -0,0 +1,85 @@ +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 10A3E431FBC + for ; Wed, 1 Oct 2014 12:43:44 -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 OB5eh8ss83iO for ; + Wed, 1 Oct 2014 12:43:40 -0700 (PDT) +Received: from cmta5.telus.net (cmta5.telus.net [209.171.16.78]) + by olra.theworths.org (Postfix) with ESMTP id AF52B431FB6 + for ; Wed, 1 Oct 2014 12:43:40 -0700 (PDT) +Received: from ovo.mains.priv ([207.102.88.62]) by cmta5.telus.net with TELUS + id xvje1o00R1LiWEf01vjekt; Wed, 01 Oct 2014 13:43:39 -0600 +X-Authority-Analysis: v=2.0 cv=JvIvWrEC c=1 sm=2 + a=EcQDfIwDZEqJA1f7rVUV8Q==:17 a=S-IsBHyFrF4A:10 a=tsa3CZZnAAAA:8 + a=ANjgZLozyFeyC-GoRkwA:9 a=EcQDfIwDZEqJA1f7rVUV8Q==:117 +X-Telus-Outbound-IP: 207.102.88.62 +From: Ian Main +To: notmuch@notmuchmail.org +Subject: [PATCH] VIM: Add a 'tag all' folder option. +Date: Wed, 1 Oct 2014 12:43:33 -0700 +Message-Id: <1412192613-16552-1-git-send-email-imain@stemwinder.org> +X-Mailer: git-send-email 1.9.3 +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: Wed, 01 Oct 2014 19:43:44 -0000 + +This adds the ability to mark an entire folder as read (or any other +tags you like once you map it). + + Ian +--- + vim/notmuch.vim | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/vim/notmuch.vim b/vim/notmuch.vim +index 331e930..3f2444b 100644 +--- a/vim/notmuch.vim ++++ b/vim/notmuch.vim +@@ -11,6 +11,7 @@ let g:loaded_notmuch = "yep" + let g:notmuch_folders_maps = { + \ '': 'folders_show_search()', + \ 's': 'folders_search_prompt()', ++ \ 'A': 'folders_tag_all("-inbox -unread")', + \ '=': 'folders_refresh()', + \ 'c': 'compose()', + \ } +@@ -378,6 +379,16 @@ ruby << EOF + EOF + endfunction + ++function! s:folders_tag_all(tags) ++ruby << EOF ++ n = $curbuf.line_number ++ s = $searches[n - 1] ++ t = VIM::evaluate('a:tags') ++ do_tag(s, t) ++EOF ++ call s:folders_refresh() ++endfunction ++ + function! s:folders() + call s:new_buffer('folders') + ruby folders_render() +-- +1.9.3 + -- 2.26.2