<<< Date Index >>>     <<< Thread Index >>>

Re: Keep Forgetting Attachments!



* Hugo Haas <hugo@xxxxxxxxx> [2004-06-19 03:52:56+0200]:
> If you use vim, then the following will do the trick (thanks for the
> idea):
[..]

Here's version 2 which removes case sensitivity:

" Checking attachments in edited emails for use in Mutt: warns user when
" exiting
" by Hugo Haas <hugo@xxxxxxxxx> - 20 June 2004
" based on an idea by The Doctor What explained at
" <mid:caq406$rq4$1@xxxxxxxxxxxxxxxxxxxxxxxx>
autocmd BufUnload mutt-* call CheckAttachments()
function! CheckAttachments()
  let l:ic = &ignorecase
  if (l:ic == 0)
    set ignorecase
  endif
  if (search('^\([^>|].*\)\?\<\(re-\?\)\?attach\(ing\|ed\|ment\)\?\>', "w") != 
0)
    let l:temp = inputdialog("Do you want to attach a file? [Hit return] ")
  endif
  if (l:ic == 0)
    set noignorecase
  endif
  echo
endfunction

Regards,

Hugo

-- 
Hugo Haas - http://larve.net/people/hugo/