[PATCH] run notmuch-hello-mode-hook at the end of the hello mode setup

Antoine Beaupré anarcat at koumbit.org
Mon Aug 8 03:26:58 PDT 2011


i mostly use this to start offlineimap.el, but it could be used for
other purposes. i have not added hooks to other modes, but those could
be interesting as well. i am unsure as to how to make unit tests for
this.
---
 emacs/notmuch-hello.el |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 65fde75..6389ac8 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -118,6 +118,11 @@ Typically \",\" in the US and UK and \".\" in Europe."
   :group 'notmuch
   :type 'string)
 
+(defcustom notmuch-hello-mode-hook nil
+  "Hook run at the end of `notmuch-hello-mode'."
+  :group 'notmuch
+  :type 'hook)
+
 (defvar notmuch-hello-url "http://notmuchmail.org"
   "The `notmuch' web site.")
 
@@ -336,6 +341,7 @@ Complete list of currently available key bindings:
  (setq major-mode 'notmuch-hello-mode
        mode-name "notmuch-hello")
  ;;(setq buffer-read-only t)
+ (run-mode-hooks 'notmuch-hello-mode 'notmuch-hello-mode-hook)
 )
 
 (defun notmuch-hello-generate-tag-alist ()
-- 
1.7.2.5



More information about the notmuch mailing list