refactor: move essential defs + init to top of core
Also adds a new error type: doom-profile-error.
This commit is contained in:
parent
2e6a69f501
commit
2383e924c0
1 changed files with 16 additions and 22 deletions
38
lisp/doom.el
38
lisp/doom.el
|
@ -88,14 +88,29 @@
|
||||||
(unless (get var 'initial-value)
|
(unless (get var 'initial-value)
|
||||||
(put var 'initial-value (default-value var))))
|
(put var 'initial-value (default-value var))))
|
||||||
|
|
||||||
|
;; Ensure Doom's core libraries are visible for loading
|
||||||
|
(add-to-list 'load-path (file-name-directory load-file-name))
|
||||||
|
|
||||||
;; Since Emacs 27, package initialization occurs before `user-init-file' is
|
;; Since Emacs 27, package initialization occurs before `user-init-file' is
|
||||||
;; loaded, but after `early-init-file'. Doom handles package initialization, so
|
;; loaded, but after `early-init-file'. Doom handles package initialization, so
|
||||||
;; we must prevent Emacs from doing it again.
|
;; we must prevent Emacs from doing it again.
|
||||||
(setq package-enable-at-startup nil)
|
(setq package-enable-at-startup nil)
|
||||||
|
|
||||||
;; Just the... bear necessities~
|
;; Custom error types
|
||||||
|
(define-error 'doom-error "An unexpected Doom error")
|
||||||
|
(define-error 'doom-core-error "Unexpected error in Doom's core" 'doom-error)
|
||||||
|
(define-error 'doom-hook-error "Error in a Doom startup hook" 'doom-error)
|
||||||
|
(define-error 'doom-autoload-error "Error in Doom's autoloads file" 'doom-error)
|
||||||
|
(define-error 'doom-user-error "Error caused by user's config or system" 'doom-error)
|
||||||
|
(define-error 'doom-module-error "Error in a Doom module" 'doom-error)
|
||||||
|
(define-error 'doom-package-error "Error with packages" 'doom-error)
|
||||||
|
(define-error 'doom-profile-error "Error while processing profiles" 'doom-error)
|
||||||
|
|
||||||
|
;; Load just the... bear necessities~
|
||||||
(require 'cl-lib)
|
(require 'cl-lib)
|
||||||
(require 'subr-x)
|
(require 'subr-x)
|
||||||
|
;; ...then load *the* one
|
||||||
|
(require 'doom-lib)
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
@ -303,17 +318,6 @@ users).")
|
||||||
(make-obsolete-variable 'NATIVECOMP "Use (featurep 'native-compile) instead" "3.0.0")
|
(make-obsolete-variable 'NATIVECOMP "Use (featurep 'native-compile) instead" "3.0.0")
|
||||||
|
|
||||||
|
|
||||||
;;
|
|
||||||
;;; Custom error types
|
|
||||||
|
|
||||||
(define-error 'doom-error "Error in Doom Emacs core")
|
|
||||||
(define-error 'doom-hook-error "Error in a Doom startup hook" 'doom-error)
|
|
||||||
(define-error 'doom-autoload-error "Error in Doom's autoloads file" 'doom-error)
|
|
||||||
(define-error 'doom-module-error "Error in a Doom module" 'doom-error)
|
|
||||||
(define-error 'doom-user-error "Error in user's config" 'doom-error)
|
|
||||||
(define-error 'doom-package-error "Error with packages" 'doom-error)
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;;; Native Compilation support (http://akrl.sdf.org/gccemacs.html)
|
;;; Native Compilation support (http://akrl.sdf.org/gccemacs.html)
|
||||||
|
|
||||||
|
@ -376,16 +380,6 @@ Otherwise, `en/disable-command' (in novice.el.gz) is hardcoded to write them to
|
||||||
(apply fn args)))
|
(apply fn args)))
|
||||||
|
|
||||||
|
|
||||||
;;
|
|
||||||
;;; Bootstrap
|
|
||||||
|
|
||||||
;; Ensure Doom's core libraries are visible for loading
|
|
||||||
(add-to-list 'load-path doom-core-dir)
|
|
||||||
|
|
||||||
;; ...then load *the* one
|
|
||||||
(require 'doom-lib)
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;;; Runtime/startup optimizations
|
;;; Runtime/startup optimizations
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue