[PATCH 1/2] emacs: define a notmuch-compose-mode based on message mode.

David Bremner david at tethera.net
Sat Aug 1 02:44:55 PDT 2015


This is to provide a clean way of overriding e.g. keybindings when
sending mail from notmuch.
---
 emacs/notmuch-mua.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 33f1399..a7d3eaa 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -265,6 +265,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-compose-mode message-mode "notmuch-compose"
+  "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.
 
@@ -281,6 +284,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-compose-mode)
   (message-sort-headers)
   (message-hide-headers)
   (set-buffer-modified-p nil)
-- 
2.1.4



More information about the notmuch mailing list