From 57133faa5caeb9b686713f2aa624628b39d2d9ae Mon Sep 17 00:00:00 2001 From: Ian Main Date: Thu, 2 Oct 2014 17:02:42 +1700 Subject: [PATCH] [PATCH] VIM v2: Add a 'tag all' folder option. --- 60/6f73af95c376530ab7fdca3ce5162213e5feb7 | 100 ++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 60/6f73af95c376530ab7fdca3ce5162213e5feb7 diff --git a/60/6f73af95c376530ab7fdca3ce5162213e5feb7 b/60/6f73af95c376530ab7fdca3ce5162213e5feb7 new file mode 100644 index 000000000..7ab87a05b --- /dev/null +++ b/60/6f73af95c376530ab7fdca3ce5162213e5feb7 @@ -0,0 +1,100 @@ +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 C0BAC431FBC + for ; Wed, 1 Oct 2014 17:02:52 -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 mGzCENFOL+Ck for ; + Wed, 1 Oct 2014 17:02:47 -0700 (PDT) +Received: from cmta19.telus.net (cmta19.telus.net [209.171.16.92]) + by olra.theworths.org (Postfix) with ESMTP id 3214F431FB6 + for ; Wed, 1 Oct 2014 17:02:47 -0700 (PDT) +Received: from ovo.mains.priv ([207.102.88.62]) by cmta19.telus.net with TELUS + id y02l1o0041LiWEf0102ljv; Wed, 01 Oct 2014 18:02:46 -0600 +X-Authority-Analysis: v=2.0 cv=fJznK+me c=1 sm=2 + a=EcQDfIwDZEqJA1f7rVUV8Q==:17 a=S-IsBHyFrF4A:10 a=tsa3CZZnAAAA:8 + a=z78UvuW0U1fkTmuEF7cA:9 a=EcQDfIwDZEqJA1f7rVUV8Q==:117 +X-Telus-Outbound-IP: 207.102.88.62 +From: Ian Main +To: notmuch@notmuchmail.org +Subject: [PATCH] VIM v2: Add a 'tag all' folder option. +Date: Wed, 1 Oct 2014 17:02:42 -0700 +Message-Id: <1412208162-30436-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: Thu, 02 Oct 2014 00:02:52 -0000 + +This adds the ability to mark an entire folder as read (or any other +tags you like once you map it). + +This update adds documentation for the command. + + Ian +--- + vim/notmuch.txt | 1 + + vim/notmuch.vim | 11 +++++++++++ + 2 files changed, 12 insertions(+) + +diff --git a/vim/notmuch.txt b/vim/notmuch.txt +index 4374102..33cbe6e 100644 +--- a/vim/notmuch.txt ++++ b/vim/notmuch.txt +@@ -47,6 +47,7 @@ MAPPINGS *notmuch-mappings* + Folder view~ + + Show selected search ++A Archive (-inbox -unread) an entire folder + s Enter a new search + = Refresh + c Compose a new mail +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