General & minor refactor

This commit is contained in:
Henrik Lissner 2017-12-23 22:13:48 -05:00
parent 1ef50bd5fa
commit 89f07f88c5
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 31 additions and 30 deletions

View file

@ -77,7 +77,7 @@ missing) and shouldn't be deleted.")
"The load path of built in Emacs libraries.")
(defvar doom--package-load-path ()
"The load path of package libraries installed via ELPA or QUELPA.")
"The load path of package libraries installed via ELPA and QUELPA.")
(defvar doom--base-load-path
(append (list doom-core-dir doom-modules-dir)
@ -130,23 +130,26 @@ are installed.
If you byte-compile core/core.el, this function will be avoided to speed up
startup."
;; Called early during initialization; only use native functions!
;; Called early during initialization; only use native (and cl-lib) functions!
(when (or force-p (not doom-init-p))
(setq load-path doom--base-load-path
package-activated-list nil)
;; Ensure core folders exist
;; Speed things up with a `load-path' for only the bare essentials
(let ((load-path doom--base-load-path))
;; Ensure core folders exist, otherwise we get errors
(dolist (dir (list doom-local-dir doom-etc-dir doom-cache-dir doom-packages-dir))
(unless (file-directory-p dir)
(make-directory dir t)))
;; Ensure core packages are installed
;; Ensure package.el is initialized; we use its state
(setq package-activated-list nil)
(condition-case _ (package-initialize t)
('error (package-refresh-contents)
(setq doom--refreshed-p t)
(package-initialize t)))
;; Ensure core packages are installed
(let ((core-packages (cl-remove-if #'package-installed-p doom-core-packages)))
(when core-packages
(message "Installing core packages")
(package-refresh-contents)
(unless doom--refreshed-p
(package-refresh-contents))
(dolist (package core-packages)
(let ((inhibit-message t))
(package-install package))
@ -154,7 +157,7 @@ startup."
(message "✓ Installed %s" package)
(error "✕ Couldn't install %s" package)))
(message "Installing core packages...done")))
(setq doom-init-p t)))
(setq doom-init-p t))))
(defun doom-initialize-load-path (&optional force-p)
(when (or force-p (not doom--package-load-path))

View file

@ -259,8 +259,7 @@ local value, whether or not it's permanent-local. Therefore, we cycle
(def-package! hideshow ; built-in
:commands (hs-minor-mode hs-toggle-hiding hs-already-hidden-p)
:config
(setq hs-hide-comments-when-hiding-all nil))
:config (setq hs-hide-comments-when-hiding-all nil))
(def-package! highlight-indentation
:commands (highlight-indentation-mode highlight-indentation-current-column-mode))
@ -310,9 +309,8 @@ local value, whether or not it's permanent-local. Therefore, we cycle
;; Helps us distinguish stacked delimiter pairs. Especially in parentheses-drunk
;; languages like Lisp.
(def-package! rainbow-delimiters
:commands rainbow-delimiters-mode
:config (setq rainbow-delimiters-max-face-count 3)
:init (add-hook 'lisp-mode-hook #'rainbow-delimiters-mode))
:hook (lisp-mode . rainbow-delimiters-mode)
:config (setq rainbow-delimiters-max-face-count 3))
;; For a distractions-free-like UI, that dynamically resizes margets and can
;; center a buffer.