fix(cli): module cli.el loader

$DOOMDIR/init.el had to be loaded earlier, so we could read the active
module list. This indirectly fixes an issue where users' literate
configs weren't being tangled on 'doom sync'.

Fix: #6479
This commit is contained in:
Henrik Lissner 2022-06-20 23:38:20 +02:00
parent fe850934f1
commit 19ce459138
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -105,6 +105,10 @@
(require 'core-cli (expand-file-name "core/core-cli" user-emacs-directory)) (require 'core-cli (expand-file-name "core/core-cli" user-emacs-directory))
;; Load $DOOMDIR/init.el, to read the user's `doom!' block, and so users can
;; customize things early, if they like.
(load! doom-module-init-file doom-private-dir t)
;; ;;
;;; Entry point ;;; Entry point
@ -218,9 +222,6 @@ SEE ALSO:
(when pager (when pager
(setenv "DOOMPAGER" pager)) (setenv "DOOMPAGER" pager))
(exit! :restart)) (exit! :restart))
;; Load $DOOMDIR/init.el, so users can customize things, if they like.
(doom-log "Loading $DOOMDIR/init.el")
(load! doom-module-init-file doom-private-dir t)
;; Load extra files and forms, as per given options. ;; Load extra files and forms, as per given options.
(dolist (file loads) (dolist (file loads)
(load (doom-path (cdr file)) (load (doom-path (cdr file))
@ -288,10 +289,9 @@ SEE ALSO:
(let ((cli-file "cli")) (let ((cli-file "cli"))
(defgroup! "Module commands" (defgroup! "Module commands"
(dolist (key (hash-table-keys doom-modules)) (dolist (key (hash-table-keys doom-modules))
(when-let* ((path (plist-get (gethash key doom-modules) path)) (when-let (path (plist-get (gethash key doom-modules) :path))
(path (car (doom-glob path cli-file))))
(defgroup! :prefix (format "+%s" (cdr key)) (defgroup! :prefix (format "+%s" (cdr key))
(defautoload! () path))))) (load! cli-file path t)))))
(doom-log "Loading $DOOMDIR/cli.el") (doom-log "Loading $DOOMDIR/cli.el")
(load! cli-file doom-private-dir t)))) (load! cli-file doom-private-dir t))))