Rethink how Doom loads core & std libs

This commit is contained in:
Henrik Lissner 2017-12-09 14:41:22 -05:00
parent 07088d3dcf
commit 9d3155892a
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 4 additions and 18 deletions

View file

@ -1,24 +1,12 @@
;;; core-lib.el -*- lexical-binding: t; -*- ;;; core-lib.el -*- lexical-binding: t; -*-
;; I don't use use-package for these to save on the `fboundp' lookups it does (require 'cl-lib)
;; for its :commands property. I use dolists instead of mapc to avoid extra (require 'subr-x)
;; stackframes allocated for lambdas. This is _definitely_ premature (load "async-autoloads" nil t)
;; optimization. (load "persistent-soft-autoloads" nil t)
(dolist (sym '(async-start async-start-process async-byte-recompile-directory
async-inject-variables))
(autoload sym "async"))
(dolist (sym '(persistent-soft-exists-p persistent-soft-fetch
persistent-soft-flush persistent-soft-store))
(autoload sym "persistent-soft"))
(dolist (sym '(when-let if-let string-trim string-join string-blank-p string-lessp))
(autoload sym "subr-x" nil nil 'macro))
(dolist (sym '(json-read json-read-file json-read-from-string json-encode)) (dolist (sym '(json-read json-read-file json-read-from-string json-encode))
(autoload sym "json")) (autoload sym "json"))
;; ;;
;; Helpers ;; Helpers
;; ;;

View file

@ -175,9 +175,7 @@ ability to invoke the debugger in debug mode."
gc-cons-percentage 0.6 gc-cons-percentage 0.6
file-name-handler-alist nil) file-name-handler-alist nil)
(require 'cl-lib)
(require 'core-packages (concat doom-core-dir "core-packages")) (require 'core-packages (concat doom-core-dir "core-packages"))
(eval-when-compile (eval-when-compile
(doom-initialize)) (doom-initialize))
(setq load-path (eval-when-compile load-path) (setq load-path (eval-when-compile load-path)