diff --git a/core/autoload/packages.el b/core/autoload/packages.el index 8b3be26c2..6451cbae4 100644 --- a/core/autoload/packages.el +++ b/core/autoload/packages.el @@ -1,6 +1,6 @@ ;;; core/autoload/packages.el -*- lexical-binding: t; -*- -(load! cache) +(load! "cache") ;;; Private functions diff --git a/core/core-dispatcher.el b/core/core-dispatcher.el index 79fd315b0..ccd0c73df 100644 --- a/core/core-dispatcher.el +++ b/core/core-dispatcher.el @@ -3,10 +3,10 @@ ;; Eagerly load these libraries because this module may be loaded in a session ;; that hasn't been fully initialized (where autoloads files haven't been ;; generated or `load-path' populated). -(load! autoload/packages) -(load! autoload/modules) -(load! autoload/debug) -(load! autoload/message) +(load! "autoload/packages") +(load! "autoload/modules") +(load! "autoload/debug") +(load! "autoload/message") ;; @@ -175,7 +175,7 @@ respectively." (def-dispatcher! test "Run Doom unit tests." - (load! autoload/test) + (load! "autoload/test") (doom//run-tests args)) (def-dispatcher! info diff --git a/core/core-packages.el b/core/core-packages.el index 9cc8ff49b..bcf3f6c97 100644 --- a/core/core-packages.el +++ b/core/core-packages.el @@ -566,12 +566,12 @@ Module load order is determined by your `doom!' block. See `doom-modules-dirs' for a list of all recognized module trees. Order defines precedence (from most to least)." (let ((doom-modules (doom-module-table (or modules t))) - init-forms config-forms file-name-handler-alist) - (maphash (lambda (key value) - (let ((path (plist-get value :path))) - (push `(let ((doom--current-module ',key)) (load! init ,path t)) + init-forms config-forms) + (maphash (lambda (key plist) + (let ((path (plist-get plist :path))) + (push `(let ((doom--current-module ',key)) (load! "init" ,path t)) init-forms) - (push `(let ((doom--current-module ',key)) (load! config ,path t)) + (push `(let ((doom--current-module ',key)) (load! "config" ,path t)) config-forms))) doom-modules) `(let (file-name-handler-alist) @@ -629,34 +629,26 @@ to have them return non-nil (or exploit that to overwrite Doom's config)." ,@body))) ((error "'%s' isn't a valid hook for def-package-hook!" when)))) -(defmacro load! (filesym &optional path noerror) +(defmacro load! (filename &optional path noerror) "Load a file relative to the current executing file (`load-file-name'). -FILESYM is either a symbol or string representing the file to load. PATH is +FILENAME is either a symbol or string representing the file to load. PATH is where to look for the file (a string representing a directory path). If omitted, the lookup is relative to `load-file-name', `byte-compile-current-file' or `buffer-file-name' (in that order). If NOERROR is non-nil, don't throw an error if the file doesn't exist." - (or (symbolp filesym) - (signal 'wrong-type-argument (list 'symbolp filesym))) - (let ((path (or (when path - (cond ((stringp path) path) - ((symbolp path) (symbol-value path)) - ((listp path) (eval path t)))) - (and (bound-and-true-p byte-compile-current-file) - (file-name-directory byte-compile-current-file)) - (and load-file-name (file-name-directory load-file-name)) - (and buffer-file-name - (file-name-directory buffer-file-name)) - (error "Could not detect path to look for '%s' in" filesym))) - (filename (symbol-name filesym))) - (let ((file (expand-file-name (concat filename ".el") path))) - (if (file-exists-p file) - `(load ,(file-name-sans-extension file) ,noerror - ,(not doom-debug-mode)) - (unless noerror - (error "Could not load file '%s' from '%s'" file path)))))) + (unless path + (setq path (or (and (bound-and-true-p byte-compile-current-file) + (file-name-directory byte-compile-current-file)) + (and load-file-name (file-name-directory load-file-name)) + (and buffer-file-name + (file-name-directory buffer-file-name)) + (error "Could not detect path to look for '%s' in" filename)))) + `(load ,(if path + `(expand-file-name ,filename ,path) + filename) + ,noerror ,(not doom-debug-mode))) (defmacro require! (module submodule &optional reload-p &rest plist) "Loads the module specified by MODULE (a property) and SUBMODULE (a symbol). @@ -671,9 +663,9 @@ The module is only loaded once. If RELOAD-P is non-nil, load it again." (if (file-directory-p module-path) `(condition-case-unless-debug ex (let ((doom--current-module ',(cons module submodule))) - (load! init ,module-path :noerror) + (load! "init" ,module-path :noerror) (let ((doom--stage 'config)) - (load! config ,module-path :noerror))) + (load! "config" ,module-path :noerror))) ('error (lwarn 'doom-modules :error "%s in '%s %s' -> %s" @@ -796,7 +788,7 @@ loads MODULE SUBMODULE's packages.el file." (flags ,flags)) (when flags (doom-module-put ,module ',submodule :flags flags)) - (load! packages ,(doom-module-locate-path module submodule) t))) + (load! "packages" ,(doom-module-locate-path module submodule) t))) ;; diff --git a/modules/app/email/config.el b/modules/app/email/config.el index 8814d6752..49274f811 100644 --- a/modules/app/email/config.el +++ b/modules/app/email/config.el @@ -174,4 +174,4 @@ default/fallback account." ;; Sub-modules ;; -(if (featurep! +gmail) (load! +gmail)) +(if (featurep! +gmail) (load! "+gmail")) diff --git a/modules/config/default/config.el b/modules/config/default/config.el index 12bd8c5ec..2dacb9b11 100644 --- a/modules/config/default/config.el +++ b/modules/config/default/config.el @@ -1,6 +1,6 @@ ;;; config/default/config.el -*- lexical-binding: t; -*- -(if (featurep! +bindings) (load! +bindings)) +(if (featurep! +bindings) (load! "+bindings")) ;; @@ -79,7 +79,7 @@ (when (featurep 'evil) (when (featurep! +evil-commands) - (load! +evil-commands)) + (load! "+evil-commands")) (when (featurep! +bindings) (defvar +default-repeat-forward-key ";") diff --git a/modules/feature/version-control/config.el b/modules/feature/version-control/config.el index d49a806b1..646517675 100644 --- a/modules/feature/version-control/config.el +++ b/modules/feature/version-control/config.el @@ -1,7 +1,7 @@ ;;; feature/version-control/config.el -*- lexical-binding: t; -*- -(load! +git) -;; TODO (load! +hg) +(load! "+git") +;; TODO (load! "+hg") ;; (setq vc-make-backup-files nil) diff --git a/modules/lang/haskell/config.el b/modules/lang/haskell/config.el index 559b244aa..6f0513258 100644 --- a/modules/lang/haskell/config.el +++ b/modules/lang/haskell/config.el @@ -1,7 +1,7 @@ ;;; lang/haskell/config.el -*- lexical-binding: t; -*- -(cond ((featurep! +intero) (load! +intero)) - ((featurep! +dante) (load! +dante))) +(cond ((featurep! +intero) (load! "+intero")) + ((featurep! +dante) (load! "+dante"))) ;; diff --git a/modules/lang/java/config.el b/modules/lang/java/config.el index 5ace2680a..0d0a10fab 100644 --- a/modules/lang/java/config.el +++ b/modules/lang/java/config.el @@ -2,9 +2,9 @@ (add-hook 'java-mode-hook #'rainbow-delimiters-mode) -(cond ((featurep! +meghanada) (load! +meghanada)) +(cond ((featurep! +meghanada) (load! "+meghanada")) ;; TODO lang/java +lsp (lsp-java?) - ;; ((featurep! +lsp) (load! +lsp)) + ;; ((featurep! +lsp) (load! "+lsp")) ) diff --git a/modules/lang/javascript/config.el b/modules/lang/javascript/config.el index c5721ff22..adda012bc 100644 --- a/modules/lang/javascript/config.el +++ b/modules/lang/javascript/config.el @@ -207,7 +207,7 @@ :match "/screeps\\(?:-ai\\)?/.+$" :modes (+javascript-npm-mode) :add-hooks (+javascript|init-screeps-mode) - :on-load (load! +screeps)) + :on-load (load! "+screeps")) (def-project-mode! +javascript-gulp-mode :files "gulpfile.js") diff --git a/modules/lang/latex/config.el b/modules/lang/latex/config.el index 758f703a7..3bd24da6e 100644 --- a/modules/lang/latex/config.el +++ b/modules/lang/latex/config.el @@ -25,7 +25,7 @@ (after! tex-site ;; Set some varibles to fontify common LaTeX commands. - (load! +fontification) + (load! "+fontification") (setq ;; Enable parse on load. TeX-parse-self t ;; When running TeX, just save, don't ask diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 09cf9b1f4..be1238292 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -4,12 +4,12 @@ "The directory where org files are kept.") ;; Sub-modules -(if (featurep! +attach) (load! +attach)) -(if (featurep! +babel) (load! +babel)) -(if (featurep! +capture) (load! +capture)) -(if (featurep! +export) (load! +export)) -(if (featurep! +present) (load! +present)) -;; TODO (if (featurep! +publish) (load! +publish)) +(if (featurep! +attach) (load! "+attach")) +(if (featurep! +babel) (load! "+babel")) +(if (featurep! +capture) (load! "+capture")) +(if (featurep! +export) (load! "+export")) +(if (featurep! +present) (load! "+present")) +;; TODO (if (featurep! +publish) (load! "+publish")) ;; diff --git a/modules/lang/web/config.el b/modules/lang/web/config.el index 3ea95eb9a..a539e3185 100644 --- a/modules/lang/web/config.el +++ b/modules/lang/web/config.el @@ -1,7 +1,7 @@ ;;; lang/web/config.el -*- lexical-binding: t; -*- -(load! +html) -(load! +css) +(load! "+html") +(load! "+css") (def-package! web-beautify diff --git a/modules/tools/password-store/test/autoload-pass.el b/modules/tools/password-store/test/autoload-pass.el index d9d190097..278159ef6 100644 --- a/modules/tools/password-store/test/autoload-pass.el +++ b/modules/tools/password-store/test/autoload-pass.el @@ -1,7 +1,7 @@ ;; -*- no-byte-compile: t; -*- ;;; tools/password-store/test/autoload-pass.el -(load! ../autoload) +(load! "../autoload") (defmacro with-passwords!! (buffer-args &rest body) (declare (indent defun)) diff --git a/modules/ui/popup/config.el b/modules/ui/popup/config.el index 68a006653..f98e0e3b5 100644 --- a/modules/ui/popup/config.el +++ b/modules/ui/popup/config.el @@ -160,4 +160,4 @@ deleted.") ;; Hacks ;; -(load! +hacks) +(load! "+hacks")