X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=vim%2Fplugin%2Fnotmuch.vim;h=6b82abedbfe2b9a655021bd6e7d99735f25356fa;hp=6726a5e79f9bcac2ffbeea34f998ff29a07e032b;hb=e7899b00d0948f5d8e75b22b9ce82037593ebcdd;hpb=5cdf424657e2fd19a4563f750b0be02cc46b8920 diff --git a/vim/plugin/notmuch.vim b/vim/plugin/notmuch.vim index 6726a5e7..6b82abed 100644 --- a/vim/plugin/notmuch.vim +++ b/vim/plugin/notmuch.vim @@ -25,6 +25,7 @@ let s:notmuch_defaults = { \ 'g:notmuch_cmd': 'notmuch' , + \ 'g:notmuch_sendmail': 'sendmail' , \ 'g:notmuch_debug': 0 , \ \ 'g:notmuch_search_newest_first': 1 , @@ -949,18 +950,19 @@ function! s:NM_compose_send() let line = getline(lnum) let lst_hdr = '' while match(line, '^$') == -1 - if match(line, '^Notmuch-Help:') == -1 + if !exists("hdr_starts") && match(line, '^Notmuch-Help:') == -1 let hdr_starts = lnum - 1 - break endif let lnum = lnum + 1 let line = getline(lnum) endwhile + let body_starts = lnum - 1 + call append(body_starts, 'Date: ' . strftime('%a, %d %b %Y %H:%M:%S %z')) exec printf(':0,%dd', hdr_starts) write - let cmdtxt = 'mailx -t < ' . fname + let cmdtxt = g:notmuch_sendmail . ' -t < ' . fname let out = system(cmdtxt) let err = v:shell_error if err