mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Add :hook property to def-project-mode!
This commit is contained in:
@ -118,6 +118,8 @@ should be activated. If they are *all* true, NAME is activated.
|
||||
function)
|
||||
|
||||
: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))
|
||||
@ -125,6 +127,7 @@ Relevant: `doom-project-hook'."
|
||||
(files (plist-get plist :files))
|
||||
(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
|
||||
@ -132,7 +135,8 @@ Relevant: `doom-project-hook'."
|
||||
,(concat "Keymap for `" (symbol-name name) "'"))
|
||||
(define-minor-mode ,name
|
||||
"A project minor mode."
|
||||
:init-value nil
|
||||
:init-value nil
|
||||
:keymap ,keymap-sym
|
||||
,hook-form)
|
||||
,(when (or modes match files when)
|
||||
`(associate! ,name
|
||||
|
Reference in New Issue
Block a user