X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch-mua.el;h=57465b205a60a7875a66fdbd39874ca56f2e376c;hb=e7b420a85446fa469df77e24c11f8afa06a2592e;hp=3e52d5e2979f8995c33aa2b0b5b4763c536414df;hpb=3c1eea5646fcf33d66acb874d82f3518a75c24de;p=notmuch diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 3e52d5e2..57465b20 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -50,7 +50,7 @@ window/frame that will be destroyed when the buffer is killed. You may want to customize `message-kill-buffer-on-exit' accordingly." (when (< emacs-major-version 24) - " Due to a known bug in Emacs 23, you should not set + " Due to a known bug in Emacs 23, you should not set this to `new-window' if `message-kill-buffer-on-exit' is disabled: this would result in an incorrect behavior.")) :group 'notmuch-send @@ -268,6 +268,12 @@ 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 +290,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 +405,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)