mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Add magic cli.el in modules & refactor module init
Doom now looks for cli.el files in your private directory or modules, giving them an opportunity to customize the CLI (add commands or reconfigure existing ones) to suit their purposes.
This commit is contained in:
9
bin/doom
9
bin/doom
@ -78,12 +78,21 @@ with a different private module."
|
||||
(when (or emacsdir doomdir localdir)
|
||||
(load! "core/core.el" user-emacs-directory))
|
||||
|
||||
;; Load any the user's private init.el or any cli.el files in modules. This
|
||||
;; gives the user (and modules) an opportunity to define their own CLI
|
||||
;; commands, or to customize the CLI to better suit them.
|
||||
(load! doom-module-init-file doom-private-dir t)
|
||||
(maphash (doom-module-loader doom-cli-file) doom-modules)
|
||||
(load! doom-cli-file doom-private-dir t)
|
||||
(run-hooks 'doom-cli-pre-hook)
|
||||
|
||||
(let (print-level print-gensym print-length)
|
||||
(condition-case e
|
||||
(if (null command)
|
||||
(doom-cli-execute "help")
|
||||
(let ((start-time (current-time)))
|
||||
(and (doom-cli-execute command args)
|
||||
(progn (run-hooks 'doom-cli-post-hook) t)
|
||||
(print! (success "Finished! (%.4fs)")
|
||||
(float-time
|
||||
(time-subtract (current-time)
|
||||
|
Reference in New Issue
Block a user