Skip to content

Commit b9933e6

Browse files
committed
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
1 parent a9866e3 commit b9933e6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+147
-145
lines changed

bin/doom

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
;; Put together, plus a strategically placed exit call, the shell will read
6363
;; one part of this file and ignore the rest, while the elisp interpreter will
6464
;; do the opposite.
65-
;; - I intentionally avoid loading site files, so core/core-cli.el can load them
65+
;; - I intentionally avoid loading site files, so lisp/doom-cli.el can load them
6666
;; by hand later. There, I can suppress and deal with unhelpful warnings (e.g.
6767
;; "package cl is deprecated"), "Loading X...DONE" spam, and any other
6868
;; disasterous side-effects.
@@ -107,7 +107,7 @@
107107
;;
108108
;;; Load Doom's CLI framework
109109

110-
(require 'core-cli (expand-file-name "core/core-cli" user-emacs-directory))
110+
(require 'doom-cli (expand-file-name "lisp/doom-cli" user-emacs-directory))
111111

112112
;; Load $DOOMDIR/init.el, to read the user's `doom!' block, and so users can
113113
;; customize things early, if they like.

bin/doomscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ tmpfile="$TMPDIR/doomscript.${__DOOMPID}"
4040

4141
target="$1"
4242
shift
43-
$emacs --load "$EMACSDIR/core/core-cli" \
43+
$emacs --load "$EMACSDIR/lisp/doom-cli" \
4444
--load "$target" \
4545
-- "$@" || exit=$?
4646
# Execute exit-script, if requested (to simulate execve)

ci.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
;;; Commentary:
33
;;; Code:
44

5-
(after! core-cli-ci
5+
(after! doom-cli-ci
66
;;; Commit linter types
77
(add-to-list 'doom-ci-commit-types 'module)
88
(add-to-list 'doom-ci-commit-scopeless-types 'module)
@@ -16,7 +16,7 @@
1616
;; DEPRECATED Will be removed once modules live in their own repo
1717
(add-to-list 'doom-ci-commit-scopes '(release "modules")))
1818

19-
(after! core-cli-make
19+
(after! doom-cli-make
2020
;;; Codeowners
2121
;; (dolist (path (cdr (doom-module-load-path (list doom-modules-dir))))
2222
;; (save-match-data

early-init.el

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
;; $EMACSDIR/profiles.el or implicitly as directories in $EMACSDIR/profiles/).
1616
;;
1717
;; You should *never* load this file in non-interactive sessions (e.g. batch
18-
;; scripts). Load `core-start' or use 'doom run' instead!
18+
;; scripts). Load `doom-start' or use 'doom run' instead!
1919
;;
2020
;;; Code:
2121

@@ -133,7 +133,7 @@
133133
;;; Bootstrap
134134

135135
;; Load the heart of Doom Emacs
136-
(unless (load (expand-file-name "core/core" user-emacs-directory) t (not init-file-debug))
136+
(unless (require 'doom (expand-file-name "lisp/doom" user-emacs-directory) t)
137137
;; ...but if that fails, then this is likely not a Doom config.
138138
(setq early-init-file (expand-file-name "early-init" user-emacs-directory))
139139
(load early-init-file t (not init-file-debug)))
@@ -147,7 +147,7 @@
147147
;; $EMACSDIR as their $DOOMDIR, if they wanted).
148148
;; - Later, 'doom sync' will dynamically generate its bootstrap file, which
149149
;; will be important for Doom's profile system later. Until then, we'll use
150-
;; core/core-start.el.
150+
;; lisp/doom-start.el.
151151
;; - A "fallback" initfile can be trivially specified, in case the
152152
;; bootstrapper is missing (if the user hasn't run 'doom sync' or is a
153153
;; first-timer). This is an opportunity to display a "safe mode" environment
@@ -158,7 +158,7 @@
158158
"Initialize Doom Emacs in an interactive session."
159159
(list (lambda ()
160160
(if (boundp 'doom-core-dir)
161-
(expand-file-name "core-start" doom-core-dir)
161+
(expand-file-name "doom-start" doom-core-dir)
162162
(expand-file-name "init.el" user-emacs-directory)))
163163
(when (boundp 'doom-profiles-dir)
164164
(lambda ()

core/cli/autoloads.el renamed to lisp/cli/autoloads.el

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;; core/cli/autoloads.el -*- lexical-binding: t; -*-
1+
;;; lisp/cli/autoloads.el -*- lexical-binding: t; -*-
22

33
(defvar doom-autoloads-excluded-packages ()
44
"What packages whose autoloads files we won't index.
@@ -49,9 +49,9 @@ one wants that.")
4949
when (boundp var)
5050
collect `(set ',var ',(symbol-value var)))
5151
(doom-autoloads--scan
52-
(append (cl-loop for dir
53-
in (append (list doom-core-dir)
54-
(cdr (doom-module-load-path 'all-p))
52+
(append (doom-glob doom-core-dir "lib/*.el")
53+
(cl-loop for dir
54+
in (append (cdr (doom-module-load-path 'all-p))
5555
(list doom-private-dir))
5656
if (doom-glob dir "autoload.el") collect (car it)
5757
if (doom-glob dir "autoload/*.el") append it)
@@ -64,7 +64,7 @@ one wants that.")
6464
doom-autoloads-excluded-files
6565
'literal)
6666
;; TODO Uncomment when profile system is implemented
67-
;; `((unless noninteractive (require 'core-start)))
67+
;; `((unless noninteractive (require 'doom-start)))
6868
)
6969
(print! (start "Byte-compiling autoloads file..."))
7070
(doom-autoloads--compile-file file)

core/cli/ci.el renamed to lisp/cli/ci.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;; core/cli/ci.el -*- lexical-binding: t; -*-
1+
;;; lisp/cli/ci.el -*- lexical-binding: t; -*-
22

33
;;
44
;;; Variables
@@ -468,5 +468,5 @@ Prevents pushing if there are unrebased or WIP commits."
468468
(exit! 1)))
469469
t)))
470470

471-
(provide 'core-cli-ci)
471+
(provide 'doom-cli-ci)
472472
;;; ci.el ends here

core/cli/compile.el renamed to lisp/cli/compile.el

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;; core/cli/commands/byte-compile.el -*- lexical-binding: t; -*-
1+
;;; lisp/cli/commands/byte-compile.el -*- lexical-binding: t; -*-
22

33
;;
44
;;; Variables
@@ -96,7 +96,7 @@ If RECOMPILE-P is non-nil, only recompile out-of-date files."
9696
;; fully loaded. Which usually aren't so in an noninteractive session.
9797
(let ((load-prefer-newer t)
9898
(noninteractive t))
99-
(require 'core-start)
99+
(require 'doom-start)
100100
(quiet! (doom-initialize-packages))
101101
(quiet! (doom-initialize-modules))))
102102

@@ -192,7 +192,7 @@ If RECOMPILE-P is non-nil, only recompile out-of-date files."
192192
(defun doom-compile-clean ()
193193
"Delete all the compiled elc files in your Emacs configuration and private
194194
module. This does not include your byte-compiled, third party packages.'"
195-
(require 'core-modules)
195+
(require 'doom-modules)
196196
(print! (start "Cleaning .elc files"))
197197
(print-group!
198198
(cl-loop with default-directory = doom-emacs-dir
@@ -213,5 +213,5 @@ module. This does not include your byte-compiled, third party packages.'"
213213
(item "\033[KNo elc files to clean"))))
214214
t))
215215

216-
(provide 'core-cli-compile)
216+
(provide 'doom-cli-compile)
217217
;;; compile.el ends here

core/cli/doctor.el renamed to lisp/cli/doctor.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;; core/cli/doctor.el --- userland heuristics and Emacs diagnostics -*- lexical-binding: t; -*-
1+
;;; lisp/cli/doctor.el --- userland heuristics and Emacs diagnostics -*- lexical-binding: t; -*-
22
;;; Commentary:
33
;;; Code:
44

@@ -162,7 +162,7 @@ in."
162162
kill-emacs-query-functions
163163
kill-emacs-hook)
164164
(defvar doom-reloading-p nil)
165-
(require 'core-start)
165+
(require 'doom-start)
166166
(doom-initialize-packages))
167167

168168
(print! (success "Initialized Doom Emacs %s") doom-version)
@@ -292,5 +292,5 @@ in."
292292
(success! "Everything seems fine, happy Emacs'ing!"))
293293
(exit! :pager? "+G"))
294294

295-
(provide 'core-cli-doctor)
295+
(provide 'doom-cli-doctor)
296296
;;; doctor.el ends here

core/cli/env.el renamed to lisp/cli/env.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;; core/cli/env.el --- envvar file generator -*- lexical-binding: t; -*-
1+
;;; lisp/cli/env.el --- envvar file generator -*- lexical-binding: t; -*-
22
;;; Commentary:
33
;;; Code:
44

@@ -136,5 +136,5 @@ Why this over exec-path-from-shell?
136136
(delete-file env-file)
137137
(print! (success "Deleted %s") (path env-file))))
138138

139-
(provide 'core-cli-env)
139+
(provide 'doom-cli-env)
140140
;;; env.el ends here

core/cli/help.el renamed to lisp/cli/help.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;; ../../projects/dotfiles/emacs/core/cli/help.el -*- lexical-binding: t; -*-
1+
;;; lisp/cli/help.el -*- lexical-binding: t; -*-
22
;;; Commentary:
33
;;
44
;; This file defines special commands that the Doom CLI will invoke when a
@@ -462,5 +462,5 @@ The alist's CAR are lists of formatted switches plus their arguments, e.g.
462462
(string-trim-right (buffer-string))))))
463463
"\n\n"))))))))))
464464

465-
(provide 'core-cli-help)
465+
(provide 'doom-cli-help)
466466
;;; help.el ends here

0 commit comments

Comments
 (0)