aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2015-08-01 11:44:55 +0200
committerDavid Bremner <david@tethera.net>2015-08-07 21:17:26 +0200
commit03aff8499d55614377d01e0296a4f186e0ed8735 (patch)
tree7b6ff9c81c405b207f8aef41b07a44f15a0ad813
parented9ceda623d3f22fb66365b33db63c5c982067d3 (diff)
emacs: define a notmuch-compose-mode based on message mode.
This is to provide a clean way of overriding e.g. keybindings when sending mail from notmuch. This is needed in particular to allow somewhere to dynamically bind certain message-mode variables which are not respected when buffer-local. See e.g. http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21174
-rw-r--r--emacs/notmuch-mua.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 3e52d5e2..10183215 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -268,6 +268,9 @@ 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 "Notmuch Message"
+ "Notmuch message composition mode. Mostly like `message-mode'")
+
(defun notmuch-mua-mail (&optional to subject other-headers &rest other-args)
"Invoke the notmuch mail composition window.
@@ -284,6 +287,7 @@ 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)
(message-sort-headers)
(message-hide-headers)
(set-buffer-modified-p nil)