Re: Keep Forgetting Attachments!
* Bennett Todd <bet@xxxxxxxxx> [2004-06-16 20:56:17+0200]:
> 2004-06-16T18:36:20 The Doctor What:
>> Okay, I have a problem:
>>
>> I'll write an email, mention an attachment and then send the email
>> without attaching the file in question.
>
> I have the same problem, chronically.
>
>> I have a possible solution:
>>
>> Have mutt check for the work attachment or attached and then prompt
>> the user "Do you need to attach a file?" immediately after exiting
>> edit mode.
>
> Brilliant! I'm gonna try that out and see how it tastes!
>
>> Would this be hard to impliment?
>
> Here's how I'm gonna implement it:
[..]
If you use vim, then the following will do the trick (thanks for the
idea):
" Checking attachments in edited emails for use in Mutt
" Hugo Haas <hugo@xxxxxxxxx> - 19 June 2004
" based on an idea by The Doctor What on 2004-06-16T18:36:20
autocmd BufUnload mutt-* call CheckAttachments()
function! CheckAttachments()
if (search('^\([^>|].*\)\?\<\(re-\?\)\?attach\(ing\|ed\|ment\)\?\>', "w") !=
0)
let l:temp = inputdialog("Do you want to attach a file? [Hit return] ")
endif
echo
endfunction
I have used a regular expression which ignores quoted text.
Regards,
Hugo
--
Hugo Haas - http://larve.net/people/hugo/