Commit graph

14 commits

Author SHA1 Message Date
Henrik Lissner
0d7c3eaf24
feat: add doom-{before,after}-init-hook
doom-before-init-hook runs before $DOOMDIR/init.el is loaded.

doom-after-init-hook runs at the *very* end of the Emacs startup
process (after window-setup-hook).
2022-09-16 01:14:23 +02:00
Henrik Lissner
b7bd27d22b
refactor(cli,lib): print levels & output redirection
This refactors how Doom captures and redirects its output (to stdout and
stderr) into a more general with-output-to! macro, and:

- Simplifies the "print level" system. The various doom-print-*-level
  variables have been removed.
- Adds a new print level: notice, which will be the default level for
  all standard output (from print!, doom-print, prin[ct1], etc).
- Adds a with-output-to! macro for capturing and redirecting
  output to multiple streams (without suppressing it from stdout). It
  can also be nested.
- Changes the following about doom-print:
  - Default :format changed to nil (was t)
  - Default :level changed to t (was `doom-print-level`)
  - No longer no-ops if OUTPUT is only whitespace
2022-09-16 01:14:20 +02:00
Henrik Lissner
6cac7b05b6
refactor(lib): tidy doom-log output
This commit reduces the debug log noise, makes it easier to
read/parse/search, and soft-introduces a convention for doom-log
messages, where they are prefixed with a unique identifier loosely named
after it's running context or calling function.

I haven't enforced it everywhere doom-log is used yet, but this is a
start.
2022-09-12 16:01:43 +02:00
Henrik Lissner
bcf7a8a554
refactor!(cli): rename cli definers for consistency
BREAKING CHANGE: If anyone is using Doom's CLI framework and are
defining their own CLIs with any of the following macros, they'll need
to be updated to their new names:

- defautoload! -> defcli-autoload!
- defgroup! -> defcli-group!
- defstub! -> defcli-stub!
- defalias! -> defcli-alias!
- defobsolete! -> defcli-obsolete!

These were renamed to make their relationship with CLIs more obvious;
they were too ambiguous otherwise.
2022-09-12 11:45:59 +02:00
Henrik Lissner
d290152a8e
refactor(lib): replace doom-debugger with advice
Writing a debugger for Elisp is too much hassle. `debug` itself isn't
very customizable without a *lot* of boilerplate, so instead of writing
my own, it's more effective to advise debug instead. Certainly, I don't
do anything with it yet, but I will soon.
2022-09-10 18:36:24 +02:00
Henrik Lissner
b121c5e1c6
refactor(lib): provide doom-libs as subfeatures
This allows us to load them via doom-require. Why not use normal
features? Because Doom's libraries are designed to be loaded as part of
Doom, and will openly rely on Doom state if needed; this is a contract I
want to enforce by ensuring their only entry points are through
`doom-require` or autoloading.

I will add them to the rest of the libraries later.

Site-node: this also adds Commentary+Code to the comment headings, as I
want a space to use that space to describe the library, when I get
around to it.
2022-09-08 00:20:26 +02:00
Henrik Lissner
a0fc7bad5a
fix(cli): create doom directories early
This is a regression from 948f946, where a bunch of mkdir calls were
removed prematurely. In v3, other processes are responsible for creating
these directories, but those haven't been implemented yet.

Fix: #6756
Amend: 948f9461a7
2022-09-07 17:25:01 +02:00
Henrik Lissner
18887163f9
tweak(cli): add lisp/cli to doom-cli-load-path by default 2022-09-07 17:25:00 +02:00
Henrik Lissner
878781e2e4
refactor(cli): remove unneeded (require 'doom)
This wasn't needed here in the first place, and was accidentally carried
over while backporting it and surrounding changes from my local v3
branch.
2022-09-06 23:53:12 +02:00
Henrik Lissner
2b1f6031b2
refactor(lib): rely less on global state for defaults
I prefer to be more explicit about these variables' defaults, then to
rely on proper load order and unverified global state to ensure they're
properly set.
2022-09-06 23:51:44 +02:00
Henrik Lissner
948f9461a7
refactor(cli): merge doom-cli-lib into doom-cli
This was done to purge superfluous files from Doom's project structure
and simplify its entry points. And with early-init.el now acting as
Doom's universal bootstrapper (see c05e615), we don't have enough
bootstrap logic to warrant being its own file.

Also removes the redundant version check, given doom.el is assured to be
loaded before doom-cli, and performs its own check.

Ref: c05e61536e
2022-09-06 23:01:39 +02:00
Henrik Lissner
aa54383b5d
refactor: deprecate doom-etc-dir for doom-data-dir
doom-etc-dir will be renamed to doom-data-dir, to better reflect its
purpose, and align it with XDG_DATA_HOME (where it will be moved to in
v3, where Doom will begin to obey XDG directory conventions more
closely).
2022-08-14 20:43:35 +02:00
Henrik Lissner
422baedad7
refactor(cli): load cli libs from doom.el
This simplifies the entry point for loading Doom (and/or its CLI
framework).
2022-08-07 19:43:28 +02:00
Henrik Lissner
b9933e6637
refactor!: restructure Doom core
BREAKING CHANGE: This restructures the project in preparation for Doom
to be split into two repos. Users that have reconfigured Doom's CLI
stand a good chance of seeing breakage, especially if they've referred
to any core-* feature, e.g.

  (after! core-cli-ci ...)

To fix it, simply s/core-/doom-/, i.e.

  (after! doom-cli-ci ...)

What this commit specifically changes is:
- Renames all core features from core-* to doom-*
- Moves core/core-* -> lisp/doom-*
- Moves core/autoloads/* -> lisp/lib/*
- Moves core/templates -> templates/

Ref: #4273
2022-07-30 22:41:13 +02:00
Renamed from core/core-cli.el (Browse further)