X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;ds=sidebyside;f=vim%2Fplugin%2Fnotmuch.vim;h=05c21d3cead8af05305b4e01aed52f25ba13fcfe;hb=e236142f039c1a77ec2a40853cec102681b33adb;hp=6b82abedbfe2b9a655021bd6e7d99735f25356fa;hpb=e7899b00d0948f5d8e75b22b9ce82037593ebcdd;p=notmuch diff --git a/vim/plugin/notmuch.vim b/vim/plugin/notmuch.vim index 6b82abed..05c21d3c 100644 --- a/vim/plugin/notmuch.vim +++ b/vim/plugin/notmuch.vim @@ -149,6 +149,7 @@ let g:notmuch_show_maps = { \ 'h': ':call NM_show_fold_toggle(''h'', ''hdr'', !g:notmuch_show_fold_headers)', \ 'i': ':call NM_show_fold_toggle(''s'', ''sig'', !g:notmuch_show_fold_signatures)', \ + \ 'I': ':call NM_show_mark_read_thread()', \ 'a': ':call NM_show_archive_thread()', \ 'A': ':call NM_show_mark_read_then_archive_thread()', \ 'N': ':call NM_show_mark_read_then_next_open_message()', @@ -496,6 +497,11 @@ function! s:NM_show_next_thread() endif endfunction +function! s:NM_show_mark_read_thread() + call NM_tag(b:nm_search_words, ['-unread']) + call NM_show_next_thread() +endfunction + function! s:NM_show_archive_thread() call NM_tag(b:nm_search_words, ['-inbox']) call NM_show_next_thread() @@ -962,7 +968,16 @@ function! s:NM_compose_send() exec printf(':0,%dd', hdr_starts) write - let cmdtxt = g:notmuch_sendmail . ' -t < ' . fname + let line = getline(1) + let m = matchlist(line, '^From:\s*\(.*\)\s*<\(.*\)>$') + if (len(m) >= 2) + let from = m[2] + else + let m = matchlist(line, '^From:\s*\(.*\)$') + let from = m[1] + endif + + let cmdtxt = g:notmuch_sendmail . ' -t -f ' . from . ' < ' . fname let out = system(cmdtxt) let err = v:shell_error if err