[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Hack to prevent forgetting attachments
- To: wl-en@ml.gentei.org
- Subject: Hack to prevent forgetting attachments
- From: Erik Hetzner <egh@e6h.org>
- Date: Fri, 19 Sep 2014 10:22:56 -0700
- Reply-to: Erik Hetzner <egh@e6h.org>
- User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (Gojō) APEL/10.8 EasyPG/1.0.0 Emacs/24.4.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)
Hi all,
gmail has a feature that reminds you if you forget an attachment. With
this bit of elisp, WL can do the same thing.
(defun egh:wl-draft-check-attachment ()
(save-excursion
(mail-text)
(if (re-search-forward "attach" nil t)
(progn
(mail-text)
(unless (re-search-forward mime-edit-beginning-tag-regexp nil t)
(unless (yes-or-no-p "You used the word `attach' in this mail, but did not include an attachment. Are you sure you want to send? ")
(error "No attachment!")))))))
(add-hook 'wl-draft-send-hook 'egh:wl-check-attachment)
best, Erik
--
Sent from my free software system <http://fsf.org/>.