Refactor Doom core init process (again)

- Eager-load all core autoloaded libraries if autoloads file isn't
  present.
- Renames functions to be more descriptive of their true purpose:
  - doom-initialize-autoloads -> doom-load-autoloads-file
  - doom-load-env-vars -> doom-load-envvars-file
- Use doom-module-p instead of featurep! for backend use (the latter is
  mainly syntax sugar for module use, and evaluates at compile/expansion
  time, which may cause hash-table-p errors early in the startup
  process).
- Reorder plist library to prevent load order race condition with the
  functions using the macros that haven't been defined yet.
This commit is contained in:
Henrik Lissner 2019-07-22 22:28:43 +02:00
parent 23d111132a
commit 93f7520c79
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
11 changed files with 109 additions and 107 deletions

View file

@ -270,7 +270,7 @@ Run this whenever your `doom!' block, or a module autoload file, is modified."
return t)))
(ignore
(print! (success "Skipping core autoloads, they are up-to-date"))
(doom-initialize-autoloads doom-autoload-file))
(doom-load-autoloads-file doom-autoload-file))
(print! (start "Regenerating core autoloads file"))
(if (doom-delete-autoloads-file doom-autoload-file)
@ -393,7 +393,7 @@ This should be run whenever your `doom!' block or update your packages."
return t)))
(ignore
(print! (success "Skipping package autoloads, they are up-to-date"))
(doom-initialize-autoloads doom-package-autoload-file))
(doom-load-autoloads-file doom-package-autoload-file))
(let (;; The following bindings are in `package-generate-autoloads'.
;; Presumably for a good reason, so I just copied them
(noninteractive t)

View file

@ -91,8 +91,8 @@ If RECOMPILE-P is non-nil, only recompile out-of-date files."
;; But first we must be sure that Doom and your private config have been
;; fully loaded. Which usually aren't so in an noninteractive session.
(doom-initialize-autoloads doom-autoload-file)
(doom-initialize-autoloads doom-package-autoload-file)
(doom-load-autoloads-file doom-autoload-file)
(doom-load-autoloads-file doom-package-autoload-file)
;;
(unless target-dirs

View file

@ -98,7 +98,7 @@ default, on Linux, this is '$SHELL -ic /usr/bin/env'. Variables in
"#\n"
"# It is NOT safe to edit this file. Changes will be overwritten next time that\n"
"# `doom env refresh` is executed. Alternatively, create your own env file and\n"
"# load it with `(doom-load-env-vars FILE)`.\n"
"# load it with `(doom-load-envvars-file FILE)`.\n"
"#\n"
"# To auto-regenerate this file when `doom reload` is run, use `doom env auto' or\n"
"# set DOOMENV=1 in your shell environment/config.\n"

View file

@ -16,8 +16,8 @@ current directory."
(patterns nil)
(args command-line-args-left)
(doom-modules (doom-modules)))
(doom-initialize-autoloads doom-autoload-file)
(doom-initialize-autoloads doom-package-autoload-file)
(doom-load-autoloads-file doom-autoload-file)
(doom-load-autoloads-file doom-package-autoload-file)
(while args
(cond
;; ((member (car args) '("--traceback"))