diff --git a/lisp/doom-cli.el b/lisp/doom-cli.el index a298433c0..942a05fed 100644 --- a/lisp/doom-cli.el +++ b/lisp/doom-cli.el @@ -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) diff --git a/lisp/lib/debug.el b/lisp/lib/debug.el index bfc30d0da..5a9fbb2f0 100644 --- a/lisp/lib/debug.el +++ b/lisp/lib/debug.el @@ -1,4 +1,6 @@ ;;; lisp/lib/debug.el -*- lexical-binding: t; -*- +;;; Commentary: +;;; Code: ;; ;;; Doom's debug mode @@ -414,3 +416,6 @@ copies it to your clipboard, ready to be pasted into bug reports!" (profiler-report) (profiler-stop)) (setq doom--profiler (not doom--profiler))) + +(provide 'doom-lib '(debug)) +;;; debug.el ends here diff --git a/lisp/lib/files.el b/lisp/lib/files.el index 5208d1c83..42d0018bc 100644 --- a/lisp/lib/files.el +++ b/lisp/lib/files.el @@ -1,4 +1,6 @@ ;;; lisp/lib/files.el -*- lexical-binding: t; -*- +;;; Commentary: +;;; Code: (defun doom-files--build-checks (spec &optional directory) "Converts a simple nested series of or/and forms into a series of @@ -507,3 +509,6 @@ If FORCE-P, overwrite the destination file if it exists, without confirmation." (setq recentf-list (delete file recentf-list)) (recentf-save-list) (message "Removed %S from `recentf-list'" (abbreviate-file-name file))) + +(provide 'doom-lib '(files)) +;;; files.el ends here diff --git a/lisp/lib/git.el b/lisp/lib/git.el index dc5d82dc1..9f91ee97c 100644 --- a/lisp/lib/git.el +++ b/lisp/lib/git.el @@ -1,4 +1,6 @@ ;;; lisp/lib/git.el -*- lexical-binding: t; -*- +;;; Commentary: +;;; Code: ;;;###autoload (defun doom-git-toplevel (&rest segments) @@ -9,3 +11,6 @@ (apply #'file-name-concat output segments) ;; TODO throw stderr as error (user-error "Not in a git repo: %s" default-directory)))) + +(provide 'doom-lib '(git)) +;;; git.el ends here diff --git a/lisp/lib/plist.el b/lisp/lib/plist.el index 4ad875d22..d50c01423 100644 --- a/lisp/lib/plist.el +++ b/lisp/lib/plist.el @@ -1,4 +1,6 @@ ;;; lisp/lib/plist.el -*- lexical-binding: t; -*- +;;; Commentary: +;;; Code: ;; ;;; Macros @@ -59,3 +61,6 @@ (push (cadr plist) keys) (setq plist (cddr plist))) keys)) + +(provide 'doom-lib '(plist)) +;;; plist.el ends here diff --git a/lisp/lib/print.el b/lisp/lib/print.el index 09f031a4d..b7b9564a2 100644 --- a/lisp/lib/print.el +++ b/lisp/lib/print.el @@ -1,16 +1,20 @@ ;;; lisp/lib/print.el -*- lexical-binding: t; -*- ;;; Commentary -;;; -;;; This is Doom's output library, for controlling what does and doesn't get -;;; logged, and provides a simple DSL for formatting output. It's mainly to -;;; serve the noninteractive use-case, as `message' is more than good enough in -;;; interactive sessions, but `print!' and `doom-log' are safe to use as a -;;; drop-in replacement. -;;; +;; +;; This is Doom's output library, for controlling what does and doesn't get +;; logged, and provides a simple DSL for formatting output. It's mainly to +;; serve the noninteractive use-case, as `message' is more than good enough in +;; interactive sessions, but `print!' and `doom-log' are safe to use as a +;; drop-in replacement. +;; ;;; Code: - +(eval-when-compile (require 'doom)) ; be silent, o'byte-compiler (require 'ansi-color) + +;; +;;; Variables + (defvar doom-print-ansi-alist '(;; fx (bold 1 :weight bold) @@ -438,3 +442,6 @@ transformative logic." (doom-print--apply (cdr forms) t) nil)) (forms))) + +(provide 'doom-lib '(print)) +;;; print.el ends here diff --git a/lisp/lib/process.el b/lisp/lib/process.el index 769095ccc..f18ebd021 100644 --- a/lisp/lib/process.el +++ b/lisp/lib/process.el @@ -1,4 +1,6 @@ ;;; lisp/lib/process.el -*- lexical-binding: t; -*- +;;; Commentary: +;;; Code: ;;;###autoload (defun doom-call-process (command &rest args) @@ -40,3 +42,6 @@ Warning: freezes indefinitely on any stdin prompt." (sit-for 0.1)) (process-exit-status process)) (string-trim (buffer-string))))) + +(provide 'doom-lib '(process)) +;;; process.el ends here diff --git a/lisp/lib/system.el b/lisp/lib/system.el index 677d2c900..2e7835375 100644 --- a/lisp/lib/system.el +++ b/lisp/lib/system.el @@ -106,3 +106,6 @@ Tries to be portable. Returns 1 if cannot be determined." (user-error "Failed to look up number of processors, because:\n\n%s" (cdr cpus))))) 1))))) + +(provide 'doom-lib '(system)) +;;; system.el ends here