Refactor macros
This commit is contained in:
parent
f2df8192ff
commit
d751be7898
8 changed files with 53 additions and 40 deletions
21
core/defuns/macros-eval.el
Normal file
21
core/defuns/macros-eval.el
Normal file
|
@ -0,0 +1,21 @@
|
|||
;;; macros-eval.el
|
||||
|
||||
;;;###autoload
|
||||
(defmacro def-builder! (mode command &optional build-file)
|
||||
"Register major/minor MODE with build COMMAND. If FILES are provided, do an additional
|
||||
check to make sure they exist in the project root."
|
||||
(let ((fn (intern (format "narf--init-builder-%s" mode))))
|
||||
`(progn
|
||||
(defun ,fn ()
|
||||
(when (or (null ,build-file)
|
||||
(narf/project-has-files ,build-file))
|
||||
(setq narf--build-command '(,command . ,build-file))))
|
||||
(add-hook! ,mode ',fn))))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro def-repl! (mode command)
|
||||
"Define a REPL for a mode."
|
||||
`(push '(,mode . ,command) rtog/mode-repl-alist))
|
||||
|
||||
(provide 'macros-eval)
|
||||
;;; macros-eval.el ends here
|
Loading…
Add table
Add a link
Reference in a new issue