From: David Bremner <>

This patch introduces a variable notmuch-reply-hook and calls it using
run-hooks. This allows people to easily override the header setup and
so forth done by notmuch.

This is my solution to trying to rationalize the headers of 'm' versus 'r';
now I just call the same hook in both cases. There is actually only 2 lines 
of code added; the rest is a defcustom, docstrings and so on.

 notmuch.el |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 6482170..f47f134 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -471,6 +471,8 @@ buffer."
        (insert "--text follows this line--")
+  (save-excursion
+    (run-hooks 'notmuch-reply-hook))
 (defun notmuch-show-reply ()
@@ -1107,6 +1109,14 @@ All currently available key bindings:
   :options '(hl-line-mode)
   :group 'notmuch)
+(defcustom notmuch-reply-hook nil
+  "List of functions to call when replying to a message.
+Run after the buffer content is returned from notmuch and before
+handing off to message mode. The function `notmuch-reply' runs
+this hook."
+  :type 'hook
+  :group 'notmuch)
 (defun notmuch-show-do-stash (text)
     (kill-new text)
     (message (concat "Saved: " text)))

notmuch mailing list

Reply via email to