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
This commit is contained in:
parent
a9866e37e4
commit
b9933e6637
69 changed files with 147 additions and 145 deletions
4
bin/doom
4
bin/doom
|
@ -62,7 +62,7 @@
|
|||
;; Put together, plus a strategically placed exit call, the shell will read
|
||||
;; one part of this file and ignore the rest, while the elisp interpreter will
|
||||
;; do the opposite.
|
||||
;; - I intentionally avoid loading site files, so core/core-cli.el can load them
|
||||
;; - I intentionally avoid loading site files, so lisp/doom-cli.el can load them
|
||||
;; by hand later. There, I can suppress and deal with unhelpful warnings (e.g.
|
||||
;; "package cl is deprecated"), "Loading X...DONE" spam, and any other
|
||||
;; disasterous side-effects.
|
||||
|
@ -107,7 +107,7 @@
|
|||
;;
|
||||
;;; Load Doom's CLI framework
|
||||
|
||||
(require 'core-cli (expand-file-name "core/core-cli" user-emacs-directory))
|
||||
(require 'doom-cli (expand-file-name "lisp/doom-cli" user-emacs-directory))
|
||||
|
||||
;; Load $DOOMDIR/init.el, to read the user's `doom!' block, and so users can
|
||||
;; customize things early, if they like.
|
||||
|
|
|
@ -40,7 +40,7 @@ tmpfile="$TMPDIR/doomscript.${__DOOMPID}"
|
|||
|
||||
target="$1"
|
||||
shift
|
||||
$emacs --load "$EMACSDIR/core/core-cli" \
|
||||
$emacs --load "$EMACSDIR/lisp/doom-cli" \
|
||||
--load "$target" \
|
||||
-- "$@" || exit=$?
|
||||
# Execute exit-script, if requested (to simulate execve)
|
||||
|
|
4
ci.el
4
ci.el
|
@ -2,7 +2,7 @@
|
|||
;;; Commentary:
|
||||
;;; Code:
|
||||
|
||||
(after! core-cli-ci
|
||||
(after! doom-cli-ci
|
||||
;;; Commit linter types
|
||||
(add-to-list 'doom-ci-commit-types 'module)
|
||||
(add-to-list 'doom-ci-commit-scopeless-types 'module)
|
||||
|
@ -16,7 +16,7 @@
|
|||
;; DEPRECATED Will be removed once modules live in their own repo
|
||||
(add-to-list 'doom-ci-commit-scopes '(release "modules")))
|
||||
|
||||
(after! core-cli-make
|
||||
(after! doom-cli-make
|
||||
;;; Codeowners
|
||||
;; (dolist (path (cdr (doom-module-load-path (list doom-modules-dir))))
|
||||
;; (save-match-data
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
;; $EMACSDIR/profiles.el or implicitly as directories in $EMACSDIR/profiles/).
|
||||
;;
|
||||
;; You should *never* load this file in non-interactive sessions (e.g. batch
|
||||
;; scripts). Load `core-start' or use 'doom run' instead!
|
||||
;; scripts). Load `doom-start' or use 'doom run' instead!
|
||||
;;
|
||||
;;; Code:
|
||||
|
||||
|
@ -133,7 +133,7 @@
|
|||
;;; Bootstrap
|
||||
|
||||
;; Load the heart of Doom Emacs
|
||||
(unless (load (expand-file-name "core/core" user-emacs-directory) t (not init-file-debug))
|
||||
(unless (require 'doom (expand-file-name "lisp/doom" user-emacs-directory) t)
|
||||
;; ...but if that fails, then this is likely not a Doom config.
|
||||
(setq early-init-file (expand-file-name "early-init" user-emacs-directory))
|
||||
(load early-init-file t (not init-file-debug)))
|
||||
|
@ -147,7 +147,7 @@
|
|||
;; $EMACSDIR as their $DOOMDIR, if they wanted).
|
||||
;; - Later, 'doom sync' will dynamically generate its bootstrap file, which
|
||||
;; will be important for Doom's profile system later. Until then, we'll use
|
||||
;; core/core-start.el.
|
||||
;; lisp/doom-start.el.
|
||||
;; - A "fallback" initfile can be trivially specified, in case the
|
||||
;; bootstrapper is missing (if the user hasn't run 'doom sync' or is a
|
||||
;; first-timer). This is an opportunity to display a "safe mode" environment
|
||||
|
@ -158,7 +158,7 @@
|
|||
"Initialize Doom Emacs in an interactive session."
|
||||
(list (lambda ()
|
||||
(if (boundp 'doom-core-dir)
|
||||
(expand-file-name "core-start" doom-core-dir)
|
||||
(expand-file-name "doom-start" doom-core-dir)
|
||||
(expand-file-name "init.el" user-emacs-directory)))
|
||||
(when (boundp 'doom-profiles-dir)
|
||||
(lambda ()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/cli/autoloads.el -*- lexical-binding: t; -*-
|
||||
;;; lisp/cli/autoloads.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defvar doom-autoloads-excluded-packages ()
|
||||
"What packages whose autoloads files we won't index.
|
||||
|
@ -49,9 +49,9 @@ one wants that.")
|
|||
when (boundp var)
|
||||
collect `(set ',var ',(symbol-value var)))
|
||||
(doom-autoloads--scan
|
||||
(append (cl-loop for dir
|
||||
in (append (list doom-core-dir)
|
||||
(cdr (doom-module-load-path 'all-p))
|
||||
(append (doom-glob doom-core-dir "lib/*.el")
|
||||
(cl-loop for dir
|
||||
in (append (cdr (doom-module-load-path 'all-p))
|
||||
(list doom-private-dir))
|
||||
if (doom-glob dir "autoload.el") collect (car it)
|
||||
if (doom-glob dir "autoload/*.el") append it)
|
||||
|
@ -64,7 +64,7 @@ one wants that.")
|
|||
doom-autoloads-excluded-files
|
||||
'literal)
|
||||
;; TODO Uncomment when profile system is implemented
|
||||
;; `((unless noninteractive (require 'core-start)))
|
||||
;; `((unless noninteractive (require 'doom-start)))
|
||||
)
|
||||
(print! (start "Byte-compiling autoloads file..."))
|
||||
(doom-autoloads--compile-file file)
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/cli/ci.el -*- lexical-binding: t; -*-
|
||||
;;; lisp/cli/ci.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;
|
||||
;;; Variables
|
||||
|
@ -468,5 +468,5 @@ Prevents pushing if there are unrebased or WIP commits."
|
|||
(exit! 1)))
|
||||
t)))
|
||||
|
||||
(provide 'core-cli-ci)
|
||||
(provide 'doom-cli-ci)
|
||||
;;; ci.el ends here
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/cli/commands/byte-compile.el -*- lexical-binding: t; -*-
|
||||
;;; lisp/cli/commands/byte-compile.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;
|
||||
;;; Variables
|
||||
|
@ -96,7 +96,7 @@ If RECOMPILE-P is non-nil, only recompile out-of-date files."
|
|||
;; fully loaded. Which usually aren't so in an noninteractive session.
|
||||
(let ((load-prefer-newer t)
|
||||
(noninteractive t))
|
||||
(require 'core-start)
|
||||
(require 'doom-start)
|
||||
(quiet! (doom-initialize-packages))
|
||||
(quiet! (doom-initialize-modules))))
|
||||
|
||||
|
@ -192,7 +192,7 @@ If RECOMPILE-P is non-nil, only recompile out-of-date files."
|
|||
(defun doom-compile-clean ()
|
||||
"Delete all the compiled elc files in your Emacs configuration and private
|
||||
module. This does not include your byte-compiled, third party packages.'"
|
||||
(require 'core-modules)
|
||||
(require 'doom-modules)
|
||||
(print! (start "Cleaning .elc files"))
|
||||
(print-group!
|
||||
(cl-loop with default-directory = doom-emacs-dir
|
||||
|
@ -213,5 +213,5 @@ module. This does not include your byte-compiled, third party packages.'"
|
|||
(item "\033[KNo elc files to clean"))))
|
||||
t))
|
||||
|
||||
(provide 'core-cli-compile)
|
||||
(provide 'doom-cli-compile)
|
||||
;;; compile.el ends here
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/cli/doctor.el --- userland heuristics and Emacs diagnostics -*- lexical-binding: t; -*-
|
||||
;;; lisp/cli/doctor.el --- userland heuristics and Emacs diagnostics -*- lexical-binding: t; -*-
|
||||
;;; Commentary:
|
||||
;;; Code:
|
||||
|
||||
|
@ -162,7 +162,7 @@ in."
|
|||
kill-emacs-query-functions
|
||||
kill-emacs-hook)
|
||||
(defvar doom-reloading-p nil)
|
||||
(require 'core-start)
|
||||
(require 'doom-start)
|
||||
(doom-initialize-packages))
|
||||
|
||||
(print! (success "Initialized Doom Emacs %s") doom-version)
|
||||
|
@ -292,5 +292,5 @@ in."
|
|||
(success! "Everything seems fine, happy Emacs'ing!"))
|
||||
(exit! :pager? "+G"))
|
||||
|
||||
(provide 'core-cli-doctor)
|
||||
(provide 'doom-cli-doctor)
|
||||
;;; doctor.el ends here
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/cli/env.el --- envvar file generator -*- lexical-binding: t; -*-
|
||||
;;; lisp/cli/env.el --- envvar file generator -*- lexical-binding: t; -*-
|
||||
;;; Commentary:
|
||||
;;; Code:
|
||||
|
||||
|
@ -136,5 +136,5 @@ Why this over exec-path-from-shell?
|
|||
(delete-file env-file)
|
||||
(print! (success "Deleted %s") (path env-file))))
|
||||
|
||||
(provide 'core-cli-env)
|
||||
(provide 'doom-cli-env)
|
||||
;;; env.el ends here
|
|
@ -1,4 +1,4 @@
|
|||
;;; ../../projects/dotfiles/emacs/core/cli/help.el -*- lexical-binding: t; -*-
|
||||
;;; lisp/cli/help.el -*- lexical-binding: t; -*-
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; 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.
|
|||
(string-trim-right (buffer-string))))))
|
||||
"\n\n"))))))))))
|
||||
|
||||
(provide 'core-cli-help)
|
||||
(provide 'doom-cli-help)
|
||||
;;; help.el ends here
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/cli/info.el --- information about your Doom install -*- lexical-binding: t; -*-
|
||||
;;; lisp/cli/info.el --- information about your Doom install -*- lexical-binding: t; -*-
|
||||
;;; Commentary:
|
||||
;;; Code:
|
||||
|
||||
|
@ -30,5 +30,5 @@
|
|||
(doom-cli-context-width context))))))
|
||||
(print! "%s" (string-trim-right (buffer-string)))))
|
||||
|
||||
(provide 'core-cli-info)
|
||||
(provide 'doom-cli-info)
|
||||
;;; info.el ends here
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/cli/install.el --- Doom Emacs install wizard -*- lexical-binding: t; -*-
|
||||
;;; lisp/cli/install.el --- Doom Emacs install wizard -*- lexical-binding: t; -*-
|
||||
;;; Commentary:
|
||||
;;; Code:
|
||||
|
||||
|
@ -27,7 +27,8 @@
|
|||
This command does the following:
|
||||
|
||||
1. Creates `$DOOMDIR' at ~/.doom.d,
|
||||
2. Copies ~/.emacs.d/init.example.el to `$DOOMDIR'/init.el (if it doesn't exist),
|
||||
2. Copies ~/.emacs.d/templates/init.example.el to `$DOOMDIR'/init.el (if it
|
||||
doesn't exist),
|
||||
3. Creates dummy files for `$DOOMDIR'/{config,packages}.el,
|
||||
4. Prompts you to generate an envvar file (same as `$ doom env`),
|
||||
5. Installs any dependencies of enabled modules (specified by `$DOOMDIR'/init.el),
|
||||
|
@ -69,9 +70,9 @@ Change `$DOOMDIR' with the `--doomdir' option, e.g.
|
|||
(with-temp-file (doom-path doom-private-dir filename)
|
||||
(insert-file-contents template))
|
||||
(print! (success "Done!")))))
|
||||
`(("init.el" . ,(doom-path doom-emacs-dir "init.example.el"))
|
||||
("config.el" . ,(doom-path doom-core-dir "templates/config.example.el"))
|
||||
("packages.el" . ,(doom-path doom-core-dir "templates/packages.example.el"))))))
|
||||
`(("init.el" . ,(doom-path doom-emacs-dir "templates/init.example.el"))
|
||||
("config.el" . ,(doom-path doom-emacs-dir "templates/config.example.el"))
|
||||
("packages.el" . ,(doom-path doom-emacs-dir "templates/packages.example.el"))))))
|
||||
|
||||
;; In case no init.el was present the first time `doom-initialize-modules' was
|
||||
;; called in core.el (e.g. on first install)
|
||||
|
@ -124,8 +125,8 @@ Change `$DOOMDIR' with the `--doomdir' option, e.g.
|
|||
|
||||
(print! (success "\nFinished! Doom is ready to go!\n"))
|
||||
(with-temp-buffer
|
||||
(insert-file-contents (doom-path doom-core-dir "templates/QUICKSTART_INTRO"))
|
||||
(insert-file-contents (doom-path doom-emacs-dir "templates/QUICKSTART_INTRO"))
|
||||
(print! "%s" (buffer-string)))))
|
||||
|
||||
(provide 'core-cli-install)
|
||||
(provide 'doom-cli-install)
|
||||
;;; install.el ends here
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/cli/make.el --- file generation commands -*- lexical-binding: t; -*-
|
||||
;;; lisp/cli/make.el --- file generation commands -*- lexical-binding: t; -*-
|
||||
;;; Commentary:
|
||||
;;; Code:
|
||||
|
||||
|
@ -59,5 +59,5 @@
|
|||
(when (buffer-modified-p)
|
||||
(save-buffer))))))
|
||||
|
||||
(provide 'core-cli-make)
|
||||
(provide 'doom-cli-make)
|
||||
;;; make.el ends here
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/cli/make/completions.el --- generate shell completion scripts -*- lexical-binding: t; -*-
|
||||
;;; lisp/cli/make/completions.el --- generate shell completion scripts -*- lexical-binding: t; -*-
|
||||
;;; Commentary:
|
||||
;;; Code:
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/cli/packages.el --- package management commands -*- lexical-binding: t; -*-
|
||||
;;; lisp/cli/packages.el --- package management commands -*- lexical-binding: t; -*-
|
||||
;;; Commentary:
|
||||
;;; Code:
|
||||
|
||||
|
@ -591,7 +591,7 @@ declaration) or dependency thereof that hasn't already been."
|
|||
(delq nil (mapcar #'doom-packages--purge-repo repos))))))
|
||||
|
||||
(defun doom-packages--purge-elpa ()
|
||||
(require 'core-packages)
|
||||
(require 'doom-packages)
|
||||
(let ((dirs (doom-files-in package-user-dir :type t :depth 0)))
|
||||
(if (not dirs)
|
||||
(prog1 0
|
||||
|
@ -809,5 +809,5 @@ However, in batch mode, print to stdout instead of stderr."
|
|||
"/dev/null")))
|
||||
(apply fn args)))
|
||||
|
||||
(provide 'core-cli-packages)
|
||||
(provide 'doom-cli-packages)
|
||||
;;; packages.el ends here
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/cli/run.el --- launching Emacs in a sandbox -*- lexical-binding: t; -*-
|
||||
;;; lisp/cli/run.el --- launching Emacs in a sandbox -*- lexical-binding: t; -*-
|
||||
;;; Commentary:
|
||||
;;; Code:
|
||||
|
||||
|
@ -99,5 +99,5 @@ performance, it is best to run Doom out of ~/.config/emacs or ~/.emacs.d."
|
|||
(print! "%s %S" (bold "Details:") (cdr e))))))))
|
||||
(terpri))))
|
||||
|
||||
(provide 'core-cli-run)
|
||||
(provide 'doom-cli-run)
|
||||
;;; run.el ends here
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/cli/sync.el --- synchronize config command -*- lexical-binding: t; -*-
|
||||
;;; lisp/cli/sync.el --- synchronize config command -*- lexical-binding: t; -*-
|
||||
;;; Commentary:
|
||||
;;; Code:
|
||||
|
||||
|
@ -80,5 +80,5 @@ OPTIONS:
|
|||
(print! (warn "Script was abruptly aborted, leaving Doom in an incomplete state!"))
|
||||
(print! (item "Run 'doom sync' to repair it.")))
|
||||
|
||||
(provide 'core-cli-sync)
|
||||
(provide 'doom-cli-sync)
|
||||
;;; sync.el ends here
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/cli/test.el -*- lexical-binding: t; -*-
|
||||
;;; lisp/cli/test.el -*- lexical-binding: t; -*-
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; The heart of Doom's test DSL and framework. Powered by either ERT or
|
||||
|
@ -44,5 +44,5 @@ Should be one of:
|
|||
|
||||
;; Nothing here yet
|
||||
|
||||
(provide 'core-cli-test)
|
||||
(provide 'doom-cli-test)
|
||||
;;; test.el ends here
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/cli/upgrade.el -*- lexical-binding: t; -*-
|
||||
;;; lisp/cli/upgrade.el -*- lexical-binding: t; -*-
|
||||
;;; Commentary:
|
||||
;;; Code:
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/core-cli-lib.el --- API+DSL for Doom's CLI framework -*- lexical-binding: t; -*-
|
||||
;;; lisp/doom-cli-lib.el --- API+DSL for Doom's CLI framework -*- lexical-binding: t; -*-
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; The heart of Doom's CLI framework. This is safe to load in interactive
|
||||
|
@ -1319,7 +1319,7 @@ COMMANDSPEC may be prefixed with any of these special keywords:
|
|||
You can define one for a specific COMMAND, or omit it to redefine the
|
||||
catch-all :dump handler.
|
||||
|
||||
The default implementation (living in core/core-cli.el) will either:
|
||||
The default implementation (living in lisp/doom-cli.el) will either:
|
||||
|
||||
a) Dump to stdout a list of `doom-cli' structs for the commands and pseudo
|
||||
commands that would've been executed had __DOOMDUMP not been set.
|
||||
|
@ -1812,5 +1812,5 @@ errors to `doom-cli-error-file')."
|
|||
;; TODO Make `git!' into a more sophisticated wrapper around git
|
||||
(defalias 'git! (doom-partial #'straight--process-run "git"))
|
||||
|
||||
(provide 'core-cli-lib)
|
||||
;;; core-cli-lib.el ends here
|
||||
(provide 'doom-cli-lib)
|
||||
;;; doom-cli-lib.el ends here
|
|
@ -1,8 +1,8 @@
|
|||
;;; core/core-cli.el --- The heart of Doom's CLI framework -*- lexical-binding: t; no-byte-compile: t; -*-
|
||||
;;; lisp/doom-cli.el --- The heart of Doom's CLI framework -*- lexical-binding: t; no-byte-compile: t; -*-
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; The bootstrapper for Doom's CLI. This is *not* safe to load in interactive
|
||||
;; sessions as it has many side-effects. Loads `core-cli-lib' instead for API
|
||||
;; sessions as it has many side-effects. Loads `doom-cli-lib' instead for API
|
||||
;; access and syntax highlighting.
|
||||
;;
|
||||
;;; Code:
|
||||
|
@ -85,23 +85,23 @@
|
|||
(load site-run-file t inhibit-message))))
|
||||
|
||||
;; Just the... bear necessities~
|
||||
(require 'core (expand-file-name "core" (file-name-directory load-file-name)))
|
||||
(require 'doom (expand-file-name "doom" (file-name-directory load-file-name)))
|
||||
|
||||
;; Load these eagerly, since autoloads haven't been generated/loaded yet
|
||||
(load! "autoload/process")
|
||||
(load! "autoload/system")
|
||||
(load! "autoload/plist")
|
||||
(load! "autoload/files")
|
||||
(load! "autoload/debug")
|
||||
(load! "autoload/print")
|
||||
;; (load! "autoload/autoloads")
|
||||
(load! "lib/process")
|
||||
(load! "lib/system")
|
||||
(load! "lib/plist")
|
||||
(load! "lib/files")
|
||||
(load! "lib/debug")
|
||||
(load! "lib/print")
|
||||
;; (load! "lib/autoloads")
|
||||
|
||||
;; Ensure straight and core packages are ready to go for CLI commands.
|
||||
(require 'core-modules)
|
||||
(require 'core-packages)
|
||||
(require 'doom-modules)
|
||||
(require 'doom-packages)
|
||||
|
||||
;; Our DSL, API, and everything nice.
|
||||
(require 'core-cli-lib)
|
||||
(require 'doom-cli-lib)
|
||||
|
||||
;; Don't generate superfluous files when writing temp buffers.
|
||||
(setq make-backup-files nil)
|
||||
|
@ -146,5 +146,5 @@
|
|||
;; Kill manually so we don't save output to logs.
|
||||
(let (kill-emacs) (kill-emacs 0))))
|
||||
|
||||
(provide 'core-cli)
|
||||
;;; core-cli.el ends here
|
||||
(provide 'doom-cli)
|
||||
;;; doom-cli.el ends here
|
|
@ -1,4 +1,4 @@
|
|||
;;; core-editor.el -*- lexical-binding: t; -*-
|
||||
;;; doom-editor.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defvar doom-detect-indentation-excluded-modes
|
||||
'(fundamental-mode pascal-mode so-long-mode)
|
||||
|
@ -720,5 +720,5 @@ on."
|
|||
;; which causes folks to redundantly install their own.
|
||||
(setq ws-butler-keep-whitespace-before-point nil))
|
||||
|
||||
(provide 'core-editor)
|
||||
;;; core-editor.el ends here
|
||||
(provide 'doom-editor)
|
||||
;;; doom-editor.el ends here
|
|
@ -1,4 +1,4 @@
|
|||
;;; core-keybinds.el -*- lexical-binding: t; -*-
|
||||
;;; doom-keybinds.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; A centralized keybinds system, integrated with `which-key' to preview
|
||||
;; available keybindings. All built into one powerful macro: `map!'. If evil is
|
||||
|
@ -458,5 +458,5 @@ States
|
|||
(map! :leader :n :desc \"Description\" \"C-c\" #'dosomething)"
|
||||
(doom--map-process rest))
|
||||
|
||||
(provide 'core-keybinds)
|
||||
;;; core-keybinds.el ends here
|
||||
(provide 'doom-keybinds)
|
||||
;;; doom-keybinds.el ends here
|
|
@ -1,4 +1,4 @@
|
|||
;;; core-lib.el -*- lexical-binding: t; -*-
|
||||
;;; doom-lib.el -*- lexical-binding: t; -*-
|
||||
|
||||
(require 'cl-lib)
|
||||
|
||||
|
@ -545,7 +545,7 @@ This is a wrapper around `eval-after-load' that:
|
|||
|
||||
(defun doom--handle-load-error (e target path)
|
||||
(let* ((source (file-name-sans-extension target))
|
||||
(err (cond ((not (featurep 'core))
|
||||
(err (cond ((not (featurep 'doom))
|
||||
(cons 'error (file-name-directory path)))
|
||||
((file-in-directory-p source doom-core-dir)
|
||||
(cons 'doom-error doom-core-dir))
|
||||
|
@ -813,5 +813,5 @@ This function accepts any number of ARGUMENTS, but ignores them.
|
|||
Also see `ignore'."
|
||||
t))
|
||||
|
||||
(provide 'core-lib)
|
||||
;;; core-lib.el ends here
|
||||
(provide 'doom-lib)
|
||||
;;; doom-lib.el ends here
|
|
@ -1,4 +1,4 @@
|
|||
;;; core-modules.el --- module & package management system -*- lexical-binding: t; -*-
|
||||
;;; doom-modules.el --- module & package management system -*- lexical-binding: t; -*-
|
||||
|
||||
(defvar doom-init-modules-p nil
|
||||
"Non-nil if `doom-initialize-modules' has run.")
|
||||
|
@ -89,10 +89,10 @@ before the user's private module.")
|
|||
|
||||
(defun doom-initialize-core-modules ()
|
||||
"Load Doom's core files for an interactive session."
|
||||
(require 'core-keybinds)
|
||||
(require 'core-ui)
|
||||
(require 'core-projects)
|
||||
(require 'core-editor))
|
||||
(require 'doom-keybinds)
|
||||
(require 'doom-ui)
|
||||
(require 'doom-projects)
|
||||
(require 'doom-editor))
|
||||
|
||||
(defun doom-module-loader (file)
|
||||
"Return a closure that loads FILE from a module.
|
||||
|
@ -459,7 +459,7 @@ should contain your `doom!' block).
|
|||
The overall load order of Doom is as follows:
|
||||
|
||||
~/.emacs.d/init.el
|
||||
~/.emacs.d/core/core.el
|
||||
~/.emacs.d/lisp/doom.el
|
||||
$DOOMDIR/init.el
|
||||
{$DOOMDIR,~/.emacs.d}/modules/*/*/init.el
|
||||
`doom-before-init-modules-hook'
|
||||
|
@ -572,5 +572,5 @@ CATEGORY and MODULE can be omitted When this macro is used from inside a module
|
|||
category module flag (file!)))))
|
||||
t))
|
||||
|
||||
(provide 'core-modules)
|
||||
;;; core-modules.el ends here
|
||||
(provide 'doom-modules)
|
||||
;;; doom-modules.el ends here
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/core-packages.el -*- lexical-binding: t; -*-
|
||||
;;; lisp/doom-packages.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; Emacs package management is opinionated, and so is Doom. Doom uses `straight'
|
||||
;; to create a declarative, lazy-loaded and (nominally) reproducible package
|
||||
|
@ -598,5 +598,5 @@ should use it!"
|
|||
else if (symbolp target)
|
||||
collect target)))))
|
||||
|
||||
(provide 'core-packages)
|
||||
;;; core-packages.el ends here
|
||||
(provide 'doom-packages)
|
||||
;;; doom-packages.el ends here
|
|
@ -1,4 +1,4 @@
|
|||
;;; core-projects.el -*- lexical-binding: t; -*-
|
||||
;;; doom-projects.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defvar doom-projectile-cache-limit 10000
|
||||
"If any project cache surpasses this many files it is purged when quitting
|
||||
|
@ -295,5 +295,5 @@ Relevant: `doom-project-hook'."
|
|||
(match
|
||||
`((add-to-list 'auto-minor-mode-alist (cons ,match #',name)))))))))
|
||||
|
||||
(provide 'core-projects)
|
||||
;;; core-projects.el ends here
|
||||
(provide 'doom-projects)
|
||||
;;; doom-projects.el ends here
|
|
@ -1,8 +1,8 @@
|
|||
;;; core/core-start.el --- bootstrapper for interactive sessions -*- lexical-binding: t; -*-
|
||||
;;; lisp/doom-start.el --- bootstrapper for interactive sessions -*- lexical-binding: t; -*-
|
||||
;;; Commentary:
|
||||
;;; Code:
|
||||
|
||||
(require 'core-modules)
|
||||
(require 'doom-modules)
|
||||
|
||||
|
||||
;;
|
||||
|
@ -190,12 +190,12 @@ If RETURN-P, return the message as a string instead of displaying it."
|
|||
;; There's a chance the user will later use package.el or straight in this
|
||||
;; interactive session. If they do, make sure they're properly initialized
|
||||
;; when they do.
|
||||
(autoload 'doom-initialize-packages "core-packages")
|
||||
(eval-after-load 'package '(require 'core-packages))
|
||||
(autoload 'doom-initialize-packages "doom-packages")
|
||||
(eval-after-load 'package '(require 'doom-packages))
|
||||
(eval-after-load 'straight '(doom-initialize-packages))
|
||||
|
||||
;; Load all things.
|
||||
(doom-initialize-modules)
|
||||
|
||||
(provide 'core-start)
|
||||
;;; core-start.el ends here
|
||||
(provide 'doom-start)
|
||||
;;; doom-start.el ends here
|
|
@ -1,4 +1,4 @@
|
|||
;;; core-ui.el -*- lexical-binding: t; -*-
|
||||
;;; doom-ui.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;
|
||||
;;; Variables
|
||||
|
@ -663,5 +663,5 @@ disable it to fix all that visual noise."
|
|||
(null (frame-parameter nil 'parent-frame)))
|
||||
(add-function :before-while whitespace-enable-predicate #'doom-is-childframes-p))
|
||||
|
||||
(provide 'core-ui)
|
||||
;;; core-ui.el ends here
|
||||
(provide 'doom-ui)
|
||||
;;; doom-ui.el ends here
|
|
@ -1,4 +1,4 @@
|
|||
;;; core.el --- the heart of the beast -*- lexical-binding: t; -*-
|
||||
;;; doom.el --- the heart of the beast -*- lexical-binding: t; -*-
|
||||
;;
|
||||
;; Author: Henrik Lissner <contact@henrik.io>
|
||||
;; URL: https://github.com/doomemacs/doomemacs
|
||||
|
@ -33,7 +33,8 @@
|
|||
;; The overall load order of Doom is as follows:
|
||||
;;
|
||||
;; $EMACSDIR/early-init.el
|
||||
;; $EMACSDIR/core/core.el
|
||||
;; $EMACSDIR/lisp/doom.el
|
||||
;; $EMACSDIR/lisp/doom-start.el
|
||||
;; $DOOMDIR/init.el
|
||||
;; {$DOOMDIR,~/.emacs.d}/modules/*/*/init.el
|
||||
;; `doom-before-init-modules-hook'
|
||||
|
@ -122,7 +123,7 @@
|
|||
(defconst doom-emacs-dir user-emacs-directory
|
||||
"The path to the currently loaded .emacs.d directory. Must end with a slash.")
|
||||
|
||||
(defconst doom-core-dir (expand-file-name "core/" doom-emacs-dir)
|
||||
(defconst doom-core-dir (expand-file-name "lisp/" doom-emacs-dir)
|
||||
"The root directory of Doom's core files. Must end with a slash.")
|
||||
|
||||
(defconst doom-modules-dir (expand-file-name "modules/" doom-emacs-dir)
|
||||
|
@ -240,7 +241,7 @@ Use this for files that change often, like cache files. Must end with a slash.")
|
|||
"Where `doom-reload-core-autoloads' stores its core autoloads.
|
||||
|
||||
This file is responsible for informing Emacs where to find all of Doom's
|
||||
autoloaded core functions (in core/autoload/*.el).")
|
||||
autoloaded core functions (in lisp/lib/*.el).")
|
||||
|
||||
(defconst doom-env-file
|
||||
(if doom-profile
|
||||
|
@ -351,7 +352,7 @@ Otherwise, `en/disable-command' (in novice.el.gz) is hardcoded to write them to
|
|||
(add-to-list 'load-path doom-core-dir)
|
||||
|
||||
;; ...then load *the* one
|
||||
(require 'core-lib)
|
||||
(require 'doom-lib)
|
||||
|
||||
|
||||
;;
|
||||
|
@ -513,5 +514,5 @@ Otherwise, `en/disable-command' (in novice.el.gz) is hardcoded to write them to
|
|||
;; compatibility fallbacks
|
||||
"gnutls-cli -p %p %h"))
|
||||
|
||||
(provide 'core)
|
||||
;;; core.el ends here
|
||||
(provide 'doom)
|
||||
;;; doom.el ends here
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/autoload/buffers.el -*- lexical-binding: t; -*-
|
||||
;;; lisp/lib/buffers.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(defvar doom-real-buffer-functions
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/autoload/config.el -*- lexical-binding: t; -*-
|
||||
;;; lisp/lib/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defvar doom-bin-dir (expand-file-name "bin/" doom-emacs-dir))
|
||||
(defvar doom-bin (expand-file-name "doom" doom-bin-dir))
|
||||
|
@ -79,7 +79,7 @@ Runs `doom-after-reload-hook' afterwards."
|
|||
(doom--if-compile (format "%S sync -e" doom-bin)
|
||||
(let ((doom-reloading-p t))
|
||||
(doom-run-hooks 'doom-before-reload-hook)
|
||||
(load "core-start")
|
||||
(load "doom-start")
|
||||
(with-demoted-errors "PRIVATE CONFIG ERROR: %s"
|
||||
(general-auto-unbind-keys)
|
||||
(unwind-protect
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/autoload/debug.el -*- lexical-binding: t; -*-
|
||||
;;; lisp/lib/debug.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;
|
||||
;;; Doom's debug mode
|
||||
|
@ -209,7 +209,7 @@ Activate this advice with:
|
|||
"Returns diagnostic information about the current Emacs session in markdown,
|
||||
ready to be pasted in a bug report on github."
|
||||
(require 'vc-git)
|
||||
(require 'core-packages)
|
||||
(require 'doom-packages)
|
||||
(let ((default-directory doom-emacs-dir))
|
||||
(letf! ((defun sh (&rest args) (cdr (apply #'doom-call-process args)))
|
||||
(defun cat (file &optional limit)
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/autoload/files.el -*- lexical-binding: t; -*-
|
||||
;;; lisp/lib/files.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defun doom--resolve-path-forms (spec &optional directory)
|
||||
"Converts a simple nested series of or/and forms into a series of
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/autoload/fonts.el -*- lexical-binding: t; -*-
|
||||
;;; lisp/lib/fonts.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(defvar doom-font-increment 2
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/autoload/help.el -*- lexical-binding: t; -*-
|
||||
;;; lisp/lib/help.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defvar doom--help-major-mode-module-alist
|
||||
'((dockerfile-mode :tools docker)
|
||||
|
@ -323,7 +323,7 @@ without needing to check if they are available."
|
|||
(file-in-directory-p (symbol-file def) doom-core-dir))
|
||||
collect
|
||||
(format (format "%%-%ds%%s" (+ maxwidth 4))
|
||||
def (propertize (format "core/%s.el" (file-name-sans-extension (file-relative-name (symbol-file def) doom-core-dir)))
|
||||
def (propertize (format "lisp/%s.el" (file-name-sans-extension (file-relative-name (symbol-file def) doom-core-dir)))
|
||||
'face 'font-lock-comment-face)))
|
||||
nil t
|
||||
(when (and (symbolp sym)
|
||||
|
@ -517,7 +517,7 @@ If prefix arg is present, refresh the cache."
|
|||
packages nil t nil nil
|
||||
(when guess (symbol-name guess))))))))
|
||||
;; TODO Refactor me.
|
||||
(require 'core-packages)
|
||||
(require 'doom-packages)
|
||||
(doom-initialize-packages)
|
||||
(help-setup-xref (list #'doom/help-packages package)
|
||||
(called-interactively-p 'interactive))
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/autoload/packages.el -*- lexical-binding: t; -*-
|
||||
;;; lisp/lib/packages.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(defun doom/reload-packages ()
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/autoload/plist.el -*- lexical-binding: t; -*-
|
||||
;;; lisp/lib/plist.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;
|
||||
;;; Macros
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/autoload/print.el -*- lexical-binding: t; -*-
|
||||
;;; lisp/lib/print.el -*- lexical-binding: t; -*-
|
||||
;;; Commentary
|
||||
;;;
|
||||
;;; This is Doom's output library, for controlling what does and doesn't get
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/autoload/process.el -*- lexical-binding: t; -*-
|
||||
;;; lisp/lib/process.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(defun doom-call-process (command &rest args)
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/autoload/projects.el -*- lexical-binding: t; -*-
|
||||
;;; lisp/lib/projects.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; HACK We forward declare these variables because they are let-bound in a
|
||||
;; number of places with no guarantee that they've been defined yet (i.e.
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/autoload/sandbox.el -*- lexical-binding: t; -*-
|
||||
;;; lisp/lib/sandbox.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defvar doom-sandbox-buffer-name "*doom:sandbox*"
|
||||
"Name of the Doom sandbox buffer.")
|
||||
|
@ -97,7 +97,7 @@
|
|||
'(--run--))
|
||||
(`vanilla-doom+ ; Doom core + modules - private config
|
||||
`(progn
|
||||
(load-file ,(expand-file-name "core.el" doom-core-dir))
|
||||
(load-file ,(expand-file-name "doom.el" doom-core-dir))
|
||||
(setq doom-modules-dirs (list doom-modules-dir))
|
||||
(let ((doom-init-modules-p t))
|
||||
(doom-initialize)
|
||||
|
@ -114,7 +114,7 @@
|
|||
(doom-run-hooks 'doom-init-modules-hook)))
|
||||
(`vanilla-doom ; only Doom core
|
||||
`(progn
|
||||
(load-file ,(expand-file-name "core.el" doom-core-dir))
|
||||
(load-file ,(expand-file-name "doom.el" doom-core-dir))
|
||||
(let ((doom-init-modules-p t))
|
||||
(doom-initialize)
|
||||
(doom-initialize-core-modules))
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/autoload/scratch.el -*- lexical-binding: t; -*-
|
||||
;;; lisp/lib/scratch.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defvar doom-scratch-default-file "__default"
|
||||
"The default file name for a project-less scratch buffer.
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/autoload/sessions.el -*- lexical-binding: t; -*-
|
||||
;;; lisp/lib/sessions.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defvar desktop-base-file-name)
|
||||
(defvar desktop-dirname)
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/autoload/cache.el -*- lexical-binding: t; -*-
|
||||
;;; lisp/lib/cache.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; This little library abstracts the process of writing arbitrary elisp values
|
||||
;; to a 2-tiered file store (in `doom-store-dir'/`doom-store-location').
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/autoload/system.el -*- lexical-binding: t; -*-
|
||||
;;; lisp/lib/system.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(defun doom-system-distro ()
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/autoload/text.el -*- lexical-binding: t; -*-
|
||||
;;; lisp/lib/text.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(defvar doom-point-in-comment-functions ()
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/autoload/themes.el -*- lexical-binding: t; -*-
|
||||
;;; lisp/lib/themes.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(defconst doom-customize-theme-hook nil)
|
|
@ -1,4 +1,4 @@
|
|||
;;; core/autoload/ui.el -*- lexical-binding: t; -*-
|
||||
;;; lisp/lib/ui.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;
|
||||
;;; Public library
|
|
@ -1,7 +1,7 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; core/packages.el
|
||||
;;; lisp/packages.el
|
||||
|
||||
;; core.el
|
||||
;; doom.el
|
||||
(package! auto-minor-mode :pin "17cfa1b54800fdef2975c0c0531dad34846a5065")
|
||||
(package! gcmh :pin "0089f9c3a6d4e9a310d0791cf6fa8f35642ecfd9")
|
||||
(package! explain-pause-mode
|
||||
|
@ -9,7 +9,7 @@
|
|||
:repo "lastquestion/explain-pause-mode")
|
||||
:pin "2356c8c3639cbeeb9751744dbe737267849b4b51")
|
||||
|
||||
;; core-packages.el
|
||||
;; doom-packages.el
|
||||
(package! straight
|
||||
:type 'core
|
||||
:recipe `(:host github
|
||||
|
@ -19,19 +19,19 @@
|
|||
:files ("straight*.el"))
|
||||
:pin "fed215348076ba9182f634e0770a175220474b5a")
|
||||
|
||||
;; core-modules.el
|
||||
;; doom-modules.el
|
||||
(package! use-package
|
||||
:type 'core
|
||||
:pin "0ad5d9d5d8a61517a207ab04bf69e71c081149eb")
|
||||
|
||||
;; core-ui.el
|
||||
;; doom-ui.el
|
||||
(package! all-the-icons :pin "b18db6be0a290e8f91fd8d8340b2b44c8b75049a")
|
||||
(package! hide-mode-line :pin "bc5d293576c5e08c29e694078b96a5ed85631942")
|
||||
(package! highlight-numbers :pin "8b4744c7f46c72b1d3d599d4fb75ef8183dee307")
|
||||
(package! rainbow-delimiters :pin "a32b39bdfe6c61c322c37226d66e1b6d4f107ed0")
|
||||
(package! restart-emacs :pin "1607da2bc657fe05ae01f7fdf26f716eafead02c")
|
||||
|
||||
;; core-editor.el
|
||||
;; doom-editor.el
|
||||
(package! better-jumper :pin "47622213783ece37d5337dc28d33b530540fc319")
|
||||
(package! dtrt-indent :pin "d4fd1b4977eb0d534844fddf01c3c51c70c57205")
|
||||
(package! helpful :pin "94a07d49a80f66f8ebc54a49a4b4f6899a65fbe3")
|
||||
|
@ -43,10 +43,10 @@
|
|||
:recipe (:host github :repo "hlissner/ws-butler")
|
||||
:pin "572a10c11b6cb88293de48acbb59a059d36f9ba5")
|
||||
|
||||
;; core-projects.el
|
||||
;; doom-projects.el
|
||||
(package! projectile :pin "dc6e7ff658789e4c6cf7c32a4b4fdf22ef9bc5a3")
|
||||
(package! project :pin "2e8da1b811d5213bd143d9d036bf7ea14741a1ae")
|
||||
|
||||
;; core-keybinds.el
|
||||
;; doom-keybinds.el
|
||||
(package! general :pin "9651024e7f40a8ac5c3f31f8675d3ebe2b667344")
|
||||
(package! which-key :pin "1ab1d0cc88843c9a614ed3226c5a1070e32e4823")
|
|
@ -261,8 +261,8 @@ verbosity when editing a file in `doom-private-dir' or `doom-emacs-dir'."
|
|||
`(progn
|
||||
(setq doom-modules ',doom-modules
|
||||
doom-disabled-packages ',doom-disabled-packages)
|
||||
(require 'core)
|
||||
(require 'core-cli-lib)
|
||||
(require 'doom)
|
||||
(require 'doom-cli-lib)
|
||||
(ignore-errors (load ,user-init-file t t))
|
||||
(setq byte-compile-warnings
|
||||
'(obsolete cl-functions
|
||||
|
|
|
@ -7,7 +7,7 @@ usage in the documentation displayed by either ~describe-function~ or
|
|||
~helpful-function~ (on [[kbd:][SPC h f]]).
|
||||
|
||||
* Table of Contents :TOC_3:
|
||||
- [[#core-lib][core-lib]]
|
||||
- [[#doom-lib][doom-lib]]
|
||||
- [[#add-hook][add-hook!]]
|
||||
- [[#add-transient-hook][add-transient-hook!]]
|
||||
- [[#after][after!]]
|
||||
|
@ -38,7 +38,7 @@ usage in the documentation displayed by either ~describe-function~ or
|
|||
- [[#unsetq-hook][unsetq-hook!]]
|
||||
- [[#use-package][use-package!]]
|
||||
|
||||
* core-lib
|
||||
* doom-lib
|
||||
** add-hook!
|
||||
:PROPERTIES:
|
||||
:added: pre-3.0.0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue