]> git.notmuchmail.org Git - notmuch/blobdiff - vim/plugin/notmuch.vim
vim: use sendmail directly
[notmuch] / vim / plugin / notmuch.vim
index f4a4f2334ac476831031052244ee2ae9ffe64666..6b82abedbfe2b9a655021bd6e7d99735f25356fa 100644 (file)
 " along with Notmuch.  If not, see <http://www.gnu.org/licenses/>.
 "
 " Authors: Bart Trojanowski <bart@jukie.net>
-" Contributors: Peter Hartman <peterjohnhartman@gmail.com>
+" Contributors: Felipe Contreras <felipe.contreras@gmail.com>,
+"   Peter Hartman <peterjohnhartman@gmail.com>
 "
 " --- configuration defaults {{{1
 
 let s:notmuch_defaults = {
         \ 'g:notmuch_cmd':                           'notmuch'                    ,
+        \ 'g:notmuch_sendmail':                      'sendmail'                   ,
         \ 'g:notmuch_debug':                         0                            ,
         \
         \ 'g:notmuch_search_newest_first':           1                            ,
@@ -495,7 +497,8 @@ function! s:NM_show_next_thread()
 endfunction
 
 function! s:NM_show_archive_thread()
-        echo 'not implemented'
+        call <SID>NM_tag(b:nm_search_words, ['-inbox'])
+        call <SID>NM_show_next_thread()
 endfunction
 
 function! s:NM_show_mark_read_then_archive_thread()
@@ -947,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