Re: [PATCH] VIM v2: Add a 'tag all' folder option.

2014-11-15 Thread David Bremner
Ian Main im...@stemwinder.org writes:

 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.

This seems to work. It also seems slightly dangerous as a keybinding,
e.g. one key can remove thousands of tags. I'd like feedback from
users about the mapping.

d
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] VIM v2: Add a 'tag all' folder option.

2014-11-15 Thread Tomi Ollila
On Sat, Nov 15 2014, David Bremner da...@tethera.net wrote:

 Ian Main im...@stemwinder.org writes:

 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.

 This seems to work. It also seems slightly dangerous as a keybinding,
 e.g. one key can remove thousands of tags. I'd like feedback from
 users about the mapping.

Maybe yes/no (or y/n) confirmation ?



 d

Tomi
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


RE: [PATCH] VIM v2: Add a 'tag all' folder option.

2014-10-24 Thread Ian Main
This one is pretty straightforward and useful too.

Ian

Ian Main wrote:
 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~
  
  enter  Show selected search
 +AArchive (-inbox -unread) an entire folder
  sEnter a new search
  =Refresh
  cCompose 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 = {
   \ 'Enter':'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
 


___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch