Detach doom-modules-dirs from doom! macro

Formerly, you were required to have a doom! call (even a blank one) in
~/.doom.d/init.el if you wanted to have private sub-modules in
~/.doom.d/modules/.

No more. It is no longer doom!'s responsibility to affect
`doom-modules-dirs`. This is now done by :config private, while the
Doom modules directory is now the initial entry in doom-modules-dirs.
This commit is contained in:
Henrik Lissner 2018-03-12 13:07:17 -04:00
parent c6931db3f8
commit 23fda88b2f
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 21 additions and 23 deletions

View file

@ -364,9 +364,6 @@ added, if the file exists."
MODULES is an malformed plist of modules to load."
(let (load-forms module file-name-handler-alist)
(let ((modules-dir
(expand-file-name "modules/" (file-name-directory (or load-file-name byte-compile-current-file)))))
(cl-pushnew modules-dir doom-modules-dirs :test #'string=)
(dolist (m modules)
(cond ((keywordp m) (setq module m))
((not module) (error "No namespace specified in `doom!' for %s" m))
@ -378,13 +375,12 @@ MODULES is an malformed plist of modules to load."
(load! init ,path t))
load-forms))))))
`(let (file-name-handler-alist)
(setq doom-modules ',doom-modules
doom-modules-dirs ',doom-modules-dirs)
(setq doom-modules ',doom-modules)
(let ((doom--initializing t))
,@(nreverse load-forms))
,(unless doom--initializing
'(unless noninteractive
(doom-initialize-modules)))))))
(doom-initialize-modules))))))
(defmacro def-package! (name &rest plist)
"A thin wrapper around `use-package'."

View file

@ -34,7 +34,7 @@ line or use --debug-init to enable this.")
(defvar doom-modules-dir (concat doom-emacs-dir "modules/")
"The main directory where Doom modules are stored.")
(defvar doom-modules-dirs nil
(defvar doom-modules-dirs (list doom-modules-dir)
"A list of module root directories. Order determines priority.")
(defvar doom-local-dir (concat doom-emacs-dir ".local/")

View file

@ -10,7 +10,9 @@ Doom Emacs.")
;; Ensure `doom//reload-autoloads', `doom//byte-compile' and
;; `doom-initialize-packages' will treat `+private-config-path' as the root of
;; this module.
(add-to-list 'doom-psuedo-module-dirs +private-config-path)
(cl-pushnew +private-config-path doom-psuedo-module-dirs)
(cl-pushnew (expand-file-name "modules/" +private-config-path)
doom-modules-dirs :test #'string=)
;;
(load (expand-file-name "init.el" +private-config-path)