I have recently moved to emacs as my mail client. I am using message-mode
to write and send email through notmuch
. Specifically, the major mode is called Message[Notmuch]
.
I would like to remap C-c C-c
(mail-send-and-exit
) and C-c C-s
(mail-send
) to safe analogues that require a confirmation in the minibuffer before the email is sent. So far I have:
(defun safe-mail-send-and-exit ()
(interactive)
(if (string-equal (read-from-minibuffer "Are you sure? ") "yes")
(mail-send-and-exit)
(message "Not sent!")))
When I call this function within message-mode
, I get an error:
Symbol’s function definition is void: mail-send-and-exit
How can I pass the context of the email and the mode to my function?
send-mail-and-exit
but in your code you refer tomail-send-and-exit
. Maybe that's why it can't find mail-send-and-exit. Unfortunately, I'm not that familiar with notmuch.mail-send
andmail-send-and-exit
, I'll edit the original post.C-c C-c
and then figure out what function it was originally bound to by doingC-h k
and thenC-c C-c
. I bet it'll be something other thanmail-send-and-exit
.