From 55f584646bfd721c32e50ff67c2938d48fa69c58 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 3 Oct 2017 03:02:53 +0200 Subject: [PATCH] Add :hook property to def-project-mode! --- core/core-projects.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/core-projects.el b/core/core-projects.el index 756df588c..071df31e5 100644 --- a/core/core-projects.el +++ b/core/core-projects.el @@ -118,6 +118,8 @@ should be activated. If they are *all* true, NAME is activated. :init FORM -- FORM to run the first time this project mode is enabled. + :hook FORM -- FORM is run each time the mode is activated. + Relevant: `doom-project-hook'." (declare (indent 1)) (let ((modes (plist-get plist :modes)) @@ -125,6 +127,7 @@ Relevant: `doom-project-hook'." (when (plist-get plist :when)) (match (plist-get plist :match)) (init-form (plist-get plist :init)) + (hook-form (plist-get plist :hook)) (keymap-sym (intern (format "%s-map" name)))) `(progn (defvar ,keymap-sym (make-sparse-keymap) @@ -132,7 +135,8 @@ Relevant: `doom-project-hook'." (define-minor-mode ,name "A project minor mode." :init-value nil - :keymap ,keymap-sym) + :keymap ,keymap-sym + ,hook-form) ,(when (or modes match files when) `(associate! ,name :modes ,modes