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.
This commit is contained in:
Henrik Lissner 2022-09-08 00:08:54 +02:00
parent a179b8d262
commit b121c5e1c6
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
8 changed files with 57 additions and 20 deletions

View file

@ -65,21 +65,23 @@
;; Load just the... bear necessities~
(require 'seq)
(require 'map)
;; Load these eagerly, since autoloads may not have been generated/loaded yet
(load! "lib/process")
(load! "lib/system")
(load! "lib/git")
(load! "lib/plist")
(load! "lib/files")
(load! "lib/debug")
(load! "lib/print")
;; (load! "lib/autoloads")
;; Use our own home-grown debugger so we can capture backtraces, make them more
;; presentable, and write them to a file. Cleaner backtraces are better UX than
;; the giant wall of text the default debugger throws up.
;; Use our own home-grown debugger so we can capture backtraces, make them
;; more presentable, and write them to a file. Cleaner backtraces are better
;; UX than the giant wall of text the default debugger throws up.
(doom-require 'doom-lib 'debug)
(setq debugger #'doom-debugger)
;; Then load the rest of Doom's libs eagerly, since autoloads may not be
;; generated/loaded yet.
(doom-require 'doom-lib 'process)
(doom-require 'doom-lib 'system)
(doom-require 'doom-lib 'git)
(doom-require 'doom-lib 'plist)
(doom-require 'doom-lib 'files)
(doom-require 'doom-lib 'print)
;; (doom-require 'doom-lib 'autoloads)
;; Ensure straight and core packages are ready to go for CLI commands.
;; (require 'doom-profiles)
(require 'doom-modules)