Refactor core initialization process

A vastly simpler bootstrap process.

Also load core libs in core-lib (duh)
This commit is contained in:
Henrik Lissner 2018-05-19 16:42:31 +02:00
parent 59f510e85f
commit fa37d7b05e
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 19 additions and 16 deletions

View file

@ -1,5 +1,10 @@
;;; core-lib.el -*- lexical-binding: t; -*-
(let ((load-path doom-site-load-path))
(require 'subr-x)
(require 'cl-lib)
(require 'map))
(eval-and-compile
(unless EMACS26+
(with-no-warnings

View file

@ -1,7 +1,5 @@
;;; core-packages.el --- package management system -*- lexical-binding: t; -*-
(require 'core-lib (concat doom-core-dir "core-lib"))
;; Emacs package management is opinionated. Unfortunately, so am I. I've bound
;; together `use-package', `quelpa' and package.el to create my own,
;; rolling-release, lazily-loaded package management system for Emacs.
@ -201,15 +199,10 @@ FORCE-P is non-nil, do it anyway.
4. Builds and caches `load-path', `Info-directory-list' and
`doom-disabled-packages' in `doom-packages-file'"
;; Called early during initialization; only use native (and cl-lib) functions!
(let ((load-path doom-site-load-path))
(require 'subr-x)
(require 'cl-lib)
(require 'map))
(when (eq doom-init-p 'internal)
(setq force-p nil))
(when (or force-p (not doom-init-p))
;; packages.el cache
(when (and force-p (file-exists-p doom-packages-file))
(when (and (or force-p noninteractive)
(file-exists-p doom-packages-file))
(message "Deleting packages.el cache")
(delete-file doom-packages-file))
(unless (load doom-packages-file 'noerror 'nomessage 'nosuffix)

View file

@ -173,14 +173,19 @@ this, you'll get stuttering and random freezes) and resets
gc-cons-threshold 16777216
gc-cons-percentage 0.15))
;;
(require 'core-packages (concat doom-core-dir "core-packages"))
(doom-initialize noninteractive)
(add-hook! '(emacs-startup-hook doom-reload-hook)
#'doom|finalize)
(when doom-private-dir
(load (concat doom-private-dir "init") t t))
;;
;; Bootstrap Doom
;;
(add-to-list 'load-path doom-core-dir)
(require 'core-packages)
(require 'core-lib)
(require 'core-os)
(unless noninteractive
(doom-initialize))
(provide 'core)
;;; core.el ends here