Major refactor: use-package-always-defer = nil & use :hook

Possibly breaking change: packages are no longer deferred by default.

Addresses #286
This commit is contained in:
Henrik Lissner 2017-12-08 22:33:12 -05:00
parent 2cbd1b9107
commit 9d81bc5a8b
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
45 changed files with 90 additions and 151 deletions

View file

@ -150,7 +150,7 @@ with functions that require it (like modeline segments)."
;; Keep track of recently opened files
(def-package! recentf
:init (add-hook 'doom-init-hook #'recentf-mode)
:hook (doom-init . recentf-mode)
:config
(setq recentf-save-file (concat doom-etc-dir "recentf")
recentf-max-menu-items 0
@ -171,7 +171,6 @@ with functions that require it (like modeline segments)."
;; Handles whitespace (tabs/spaces) settings externally. This way projects can
;; specify their own formatting rules.
(def-package! editorconfig
:demand t
:init
(def-setting! :editorconfig (action value)
":add or :remove an entry in `editorconfig-indentation-alist'."
@ -230,17 +229,16 @@ extension, try to guess one."
;; Auto-close delimiters and blocks as you type
(def-package! smartparens
:demand t
:config
(add-hook 'doom-init-hook #'smartparens-global-mode)
(require 'smartparens-config)
(setq sp-autowrap-region nil ; let evil-surround handle this
sp-highlight-pair-overlay nil
sp-cancel-autoskip-on-backward-movement nil
sp-show-pair-delay 0
sp-max-pair-length 3)
(add-hook 'doom-init-hook #'smartparens-global-mode)
(require 'smartparens-config)
;; disable smartparens in evil-mode's replace state (they conflict)
(add-hook 'evil-replace-state-entry-hook #'turn-off-smartparens-mode)
(add-hook 'evil-replace-state-exit-hook #'turn-on-smartparens-mode)
@ -250,10 +248,8 @@ extension, try to guess one."
;; Branching undo
(def-package! undo-tree
:demand t
:config
(global-undo-tree-mode +1)
(add-hook 'doom-init-hook #'global-undo-tree-mode)
;; persistent undo history is known to cause undo history corruption, which
;; can be very destructive! So disable it!
(setq undo-tree-auto-save-history nil

View file

@ -24,7 +24,6 @@
;;
(def-package! which-key
:demand t
:config
(setq which-key-sort-order #'which-key-prefix-then-key-order
which-key-sort-uppercase-first nil
@ -38,7 +37,6 @@
(def-package! hydra
:demand t
:init
;; In case I later need to wrap defhydra in any special functionality.
(defalias 'def-hydra! 'defhydra)

View file

@ -109,8 +109,6 @@ base by `doom!' and for calculating how many packages exist.")
"gnutls-cli -p %p %h"
"openssl s_client -connect %h:%p -no_ssl2 -no_ssl3 -ign_eof")
use-package-always-defer t
use-package-always-ensure nil
use-package-verbose doom-debug-mode
use-package-minimum-reported-time (if doom-debug-mode 0 0.1)

View file

@ -88,7 +88,6 @@ recognized by DOOM's popup system. They are:
;;
(def-package! shackle
:demand t
:init
(setq shackle-default-alignment 'below
shackle-default-size 8

View file

@ -5,7 +5,6 @@
state are passed in.")
(def-package! projectile
:demand t
:init
(setq projectile-cache-file (concat doom-cache-dir "projectile.cache")
projectile-enable-caching (not noninteractive)

View file

@ -296,7 +296,7 @@ local value, whether or not it's permanent-local. Therefore, we cycle
;; Highlights the current line
(def-package! hl-line ; built-in
:init (add-hook! (prog-mode text-mode conf-mode) #'hl-line-mode)
:hook ((prog-mode text-mode conf-mode) . hl-line-mode)
:config
;; I don't need hl-line showing in other windows. This also offers a small
;; speed boost when buffer is displayed in multiple windows.