X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;ds=sidebyside;f=emacs%2Fnotmuch-mua.el;h=803459a7a7752a948cc42350c716068c07a93b44;hb=d0553ad524f241ba42f685cba6745c8a3a9ba20a;hp=3e52d5e2979f8995c33aa2b0b5b4763c536414df;hpb=3c1eea5646fcf33d66acb874d82f3518a75c24de;p=notmuch diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 3e52d5e2..803459a7 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -268,6 +268,13 @@ Note that these functions use `mail-citation-hook' if that is non-nil." (message-goto-body) (set-buffer-modified-p nil)) +(define-derived-mode notmuch-message-mode message-mode "Message[Notmuch]" + "Notmuch message composition mode. Mostly like `message-mode'") + +(define-key notmuch-message-mode-map (kbd "C-c C-c") #'notmuch-mua-send-and-exit) +(define-key notmuch-message-mode-map (kbd "C-c C-s") #'notmuch-mua-send) + + (defun notmuch-mua-mail (&optional to subject other-headers &rest other-args) "Invoke the notmuch mail composition window. @@ -284,6 +291,8 @@ OTHER-ARGS are passed through to `message-mail'." (notmuch-user-name) " <" (notmuch-user-primary-email) ">")) other-headers)) (apply #'message-mail to subject other-headers other-args) + (notmuch-message-mode) + (notmuch-fcc-header-setup) (message-sort-headers) (message-hide-headers) (set-buffer-modified-p nil) @@ -397,7 +406,13 @@ will be addressed to all recipients of the source message." (defun notmuch-mua-send-and-exit (&optional arg) (interactive "P") - (message-send-and-exit arg)) + (let ((message-fcc-handler-function #'notmuch-fcc-handler)) + (message-send-and-exit arg))) + +(defun notmuch-mua-send (&optional arg) + (interactive "P") + (let ((message-fcc-handler-function #'notmuch-fcc-handler)) + (message-send arg))) (defun notmuch-mua-kill-buffer () (interactive)