From 5e35ef1ee274f084dc4b55c000c988ac80e26545 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 26 Feb 2016 17:58:42 -0500 Subject: [PATCH] Refactor bootstrap --- bootstrap.el | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/bootstrap.el b/bootstrap.el index 31cc8fb2c..8e18c8df6 100644 --- a/bootstrap.el +++ b/bootstrap.el @@ -49,36 +49,33 @@ (push file result))) result))) -;; Scan various folders to populate the load-paths +(defvar narf--load-path load-path) (defun narf/reload () (interactive) - (setq custom-theme-load-path - (eval-when-compile - (append (--subdirs (concat narf-private-dir "themes/")) - custom-theme-load-path))) (setq load-path - (eval-when-compile - (require 'cask) - (cask-initialize) - (setq load-path (append (list narf-private-dir) - (--subdirs narf-core-dir t) - (--subdirs narf-modules-dir t) - (--subdirs narf-packages-dir) - load-path))))) -(narf/reload) + (progn (require 'cask) + (cask-initialize) + (append (list narf-private-dir) + (--subdirs narf-core-dir t) + (--subdirs narf-modules-dir t) + (--subdirs narf-packages-dir) + narf--load-path)))) (defun narf (packages) "Bootstrap NARF emacs and initialize PACKAGES" ;; prematurely optimize for faster startup (let (file-name-handler-alist (gc-cons-threshold 169715200)) + ;; Scan various folders to populate the load-paths + (setq custom-theme-load-path + (append (list (expand-file-name "themes/" narf-private-dir)) + custom-theme-load-path) + load-path (eval-when-compile (narf/reload))) ;; Load local settings, if available (when (file-exists-p "~/.emacs.local.el") (load "~/.emacs.local.el")) - (load-theme narf-theme t) (setq narf-current-theme narf-theme) - (mapc 'require packages))) ;;; bootstrap.el ends here