let s:notmuch_reader_default = 'mutt -f %s'
let s:notmuch_sendmail_default = 'sendmail'
let s:notmuch_folders_count_threads_default = 0
+let s:notmuch_compose_start_insert_default = 1
function! s:new_file_buffer(type, fname)
exec printf('edit %s', a:fname)
let b:compose_done = 0
call s:set_map(g:notmuch_compose_maps)
autocmd BufDelete <buffer> call s:on_compose_delete()
- startinsert!
+ if g:notmuch_compose_start_insert
+ startinsert!
+ end
endfunction
function! s:compose()
let b:compose_done = 0
call s:set_map(g:notmuch_compose_maps)
autocmd BufDelete <buffer> call s:on_compose_delete()
- startinsert!
+ if g:notmuch_compose_start_insert
+ startinsert!
+ end
endfunction
function! s:show_info()
endif
endif
+ if !exists('g:notmuch_compose_start_insert')
+ let g:notmuch_compose_start_insert = s:notmuch_compose_start_insert_default
+ endif
+
if !exists('g:notmuch_custom_search_maps') && exists('g:notmuch_rb_custom_search_maps')
let g:notmuch_custom_search_maps = g:notmuch_rb_custom_search_maps
endif
$db_name = nil
$email = $email_name = $email_address = nil
+ $exclude_tags = []
$searches = []
$threads = []
$messages = []
$email_address = get_config_item('user.primary_email')
$email_name = get_config_item('user.name')
$email = "%s <%s>" % [$email_name, $email_address]
+ ignore_tags = get_config_item('search.exclude_tags')
+ $exclude_tags = ignore_tags.split("\n")
end
def vim_puts(s)
$searches.clear
folders.each do |name, search|
q = $curbuf.query(search)
+ $exclude_tags.each { |t|
+ q.add_tag_exclude(t)
+ }
$searches << search
- count = count_threads ? q.search_threads.count : q.search_messages.count
+ count = count_threads ? q.count_threads : q.count_messages
b << "%9d %-20s (%s)" % [count, name, search]
end
end
date_fmt = VIM::evaluate('g:notmuch_date_format')
q = $curbuf.query(search)
q.sort = Notmuch::SORT_NEWEST_FIRST
+ $exclude_tags.each { |t|
+ q.add_tag_exclude(t)
+ }
$threads.clear
t = q.search_threads
date = Time.at(e.newest_date).strftime(date_fmt)
subject = e.messages.first['subject']
if $mail_installed
- subject = Mail::Field.new("Subject: " + subject).to_s
+ subject = Mail::Field.parse("Subject: " + subject).to_s
else
subject = subject.force_encoding('utf-8')
end