doomemacs/lisp/lib
Henrik Lissner f9201eb218
refactor: introduce doom-context
Introduces a system to announce what execution contexts are active, so I
can react appropriately, emit more helpful logs/warnings in the case of
issues, and throw more meaningful errors.

* bin/doom: load module CLIs in the 'modules' context.
* lisp/cli/doctor.el: load package files in 'packages' context.
* lisp/doom-cli.el:
  - (doom-before-init-hook, doom-after-init-hook): trigger hooks at the
    correct time. This may increase startup load time, as the benchmark
    now times more of the startup process.
  - (doom-cli-execute, doom-cli-context-execute,
    doom-cli-context-restore, doom-cli-context-parse,
    doom-cli--output-benchmark-h, doom-cli-call, doom-cli--restart,
    doom-cli-load, run!): remove redundant context prefix in debug logs,
    it's now redundant with doom-context, which doom-log now prefixes
    them with.
* lisp/doom-lib.el (doom-log): prefix doom-context to doom-log output,
  unless it starts with :.
* lisp/doom-packages.el (package!, doom-packages--read): throw error if
  not used in a packages.el file or in the context of our package
  manager.
* lisp/doom-profiles.el (doom-profile--generate-init-vars,
  doom-profile--generate-load-modules): use modules doom-context instead
  of doom-init-time to detect startup.
* lisp/doom-start.el (doom-load-packages-incrementally-h): move function
  closer to end of doom-after-init-hook.
* lisp/doom.el:
  - (doom-before-init-hook, doom--set-initial-values-h,
    doom--begin-init-h): rename doom--set-initial-values-h to
    doom--begin-init-h and ensure it runs as late in
    doom-before-init-hook as possible, as that is the point where Doom's
    "initialization" formally begins.
  - (doom-after-init-hook): don't trigger at the end of command-line-1
    in non-interactive sessions. This will be triggered manually in
    doom-cli.el's run!.
* lisp/lib/config.el (doom/reload, doom/reload-autoloads,
  doom/reload-env): use 'reload' context for reload commands.
* modules/lang/emacs-lisp/autoload.el (+emacs-lisp-eval): use 'eval'
  context.
* modules/lang/org/config.el: remove doom-reloading-p; check for
  'reload' doom context instead.
2022-09-24 22:09:05 +02:00
..
autoloads.el perf: disable autoload-compute-prefixes & optimize var cache 2022-09-20 01:43:33 +02:00
buffers.el refactor: replace doom-enlist with ensure-list 2022-08-07 19:43:13 +02:00
config.el refactor: introduce doom-context 2022-09-24 22:09:05 +02:00
debug.el refactor: use doom-module-*-file variables; add two 2022-09-24 20:31:34 +02:00
docs.el bump: :lang org 2022-09-18 13:10:49 +02:00
files.el fix(lib): void-function insert-into-buffer on Emacs 27 2022-09-16 01:14:20 +02:00
fonts.el refactor!: restructure Doom core 2022-07-30 22:41:13 +02:00
git.el refactor(lib): provide doom-libs as subfeatures 2022-09-08 00:20:26 +02:00
help.el fix(lib): doom/help-search-{load-path,loaded-files} 2022-09-20 02:29:08 +02:00
packages.el refactor: use doom-module-*-file variables; add two 2022-09-24 20:31:34 +02:00
plist.el refactor(lib): provide doom-libs as subfeatures 2022-09-08 00:20:26 +02:00
print.el fix(cli): debug output despite no debug-mode 2022-09-19 17:33:25 +02:00
process.el refactor(lib): provide doom-libs as subfeatures 2022-09-08 00:20:26 +02:00
projects.el refactor!: restructure Doom core 2022-07-30 22:41:13 +02:00
sandbox.el refactor!: redesign module init/config hooks 2022-09-16 01:14:22 +02:00
scratch.el refactor: deprecate doom-etc-dir for doom-data-dir 2022-08-14 20:43:35 +02:00
sessions.el refactor!: restructure Doom core 2022-07-30 22:41:13 +02:00
store.el refactor: deprecate doom-etc-dir for doom-data-dir 2022-08-14 20:43:35 +02:00
system.el refactor(lib): use num-processors 2022-09-08 13:36:17 +02:00
text.el refactor: replace doom-enlist with ensure-list 2022-08-07 19:43:13 +02:00
themes.el refactor: replace doom-enlist with ensure-list 2022-08-07 19:43:13 +02:00
ui.el refactor!: restructure Doom core 2022-07-30 22:41:13 +02:00