diff options
| author | Jakob L. Kreuze | 2019-05-23 11:23:27 -0400 |
|---|---|---|
| committer | Jakob L. Kreuze | 2019-05-23 11:25:58 -0400 |
| commit | 48d39f7896604336495cd23e072fef93a4f1a313 (patch) | |
| tree | 53765620231069394b9871370e5835d66c38ff30 | |
| parent | 6a1066160a2d47fdfd63c67db2cdf71e2fea4e8b (diff) | |
Use :after instad of 'when-all-loaded
| -rw-r--r-- | jakob.org | 40 |
1 files changed, 8 insertions, 32 deletions
@@ -88,31 +88,6 @@ without reqiring an explicit =:straight t=. :diminish visual-line-mode) #+END_SRC -** Dependency Management - -=use-package= provies a number of features such as =:after= to defer the loading of -packages and their configurations until some other package has been loaded, but -I've wrestled witth this functionality for weeks now and realized that it's not -well-suited for configuring packages in a way that depends on symbols from -another package. As an alternative, I've chosen to use the =with-eval-after-load= -machinery provided by Vanilla Emacs, albeit wrapped in a slightly more ergnomic -macro that allows for dependence on multiple packages rather than just one. - -#+BEGIN_SRC elisp -(defmacro when-all-loaded (files &rest form) - "Nests FORM in several `with-eval-after-load' for each of FILES. -FILES can be either a symbol, representing dependence on a single -package, or a list of symbols, representing dependence on more -than one package." - (let ((form `(progn ,@form)) - (files (if (symbolp files) (list files) files))) - (dolist (file files) - (setq form `(with-eval-after-load (quote ,file) ,form))) - form)) - -(put 'when-all-loaded 'lisp-indent-function 1) -#+END_SRC - ** Libraries A handful of the Elisp snippets in this file depend on third-party libraries @@ -1727,9 +1702,9 @@ private message. #+BEGIN_SRC elisp (use-package ercn - :init - (when-all-loaded erc - (add-hook 'ercn-notify 'dunst-alert))) + :after erc + :config + (add-hook 'ercn-notify 'dunst-alert)) #+END_SRC Configure =erc-hl-nicks= to show names using pretty colors. @@ -1812,7 +1787,7 @@ change." (current-buffer))))) (delete-overlay erc-bar-overlay)))) -(when-all-loaded erc +(with-eval-after-load 'erc ;; Run the hook before 'erc-modified-channels-update (defadvice erc-track-mode (after erc-bar-setup-hook (&rest args) activate) @@ -2285,6 +2260,8 @@ Set up [[company]]. #+BEGIN_SRC elisp (use-package company-jedi + :after company + :hook (python-mode . company-mode) (python-mode . jedi:setup) @@ -2293,9 +2270,8 @@ Set up [[company]]. (setq jedi:complete-on-dot t) (setq jedi:tooltip-method nil) - :init - (when-all-loaded company - (add-to-list 'company-backends 'company-jedi))) + :config + (add-to-list 'company-backends 'company-jedi)) #+END_SRC ** Hy |