diff options
author | John Lee <jjl@pobox.com> | 2020-05-09 19:01:01 +0100 |
---|---|---|
committer | John Lee <jjl@pobox.com> | 2020-05-09 23:46:53 +0100 |
commit | f30d5761af12836844b2e3e8da11f649a31d8abf (patch) | |
tree | d9a81ac3c2befd83d38a7a7abe8a98abffe34653 /lisp/use-package/use-package-core.el | |
parent | 91e5d275af4087f954ac0af75326eb269b984655 (diff) | |
download | emacs-f30d5761af12836844b2e3e8da11f649a31d8abf.tar.gz emacs-f30d5761af12836844b2e3e8da11f649a31d8abf.tar.bz2 emacs-f30d5761af12836844b2e3e8da11f649a31d8abf.zip |
Even when there's no :config, run any pre/post config hooks
i.e., following the existing docs for use-package-inject-hooks, these hooks are
run:
use-package--foo--pre-config-hook
use-package--foo--post-config-hook
This should make config customisations more predictable (for example, spacemacs
uses these hooks extensively to allow 'layers' to be customised).
I got rid of the "special" default value for :config, because it doesn't seem to
be treated any differently than nil.
Fixes https://github.com/jwiegley/use-package/issues/785
Copyright-paperwork-exempt: yes
Diffstat (limited to 'lisp/use-package/use-package-core.el')
-rw-r--r-- | lisp/use-package/use-package-core.el | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el index c18877d5e66..f547fcfa5ae 100644 --- a/lisp/use-package/use-package-core.el +++ b/lisp/use-package/use-package-core.el @@ -156,8 +156,7 @@ See also `use-package-defaults', which uses this value." :group 'use-package) (defcustom use-package-defaults - '(;; this '(t) has special meaning; see `use-package-handler/:config' - (:config '(t) t) + '((:config nil t) (:init nil t) (:catch t (lambda (name args) (not use-package-expand-minimally))) @@ -1468,7 +1467,7 @@ no keyword implies `:all'." (use-package-concat (when use-package-compute-statistics `((use-package-statistics-gather :config ',name nil))) - (if (or (null arg) (equal arg '(t))) + (if (and (null arg) (not use-package-inject-hooks)) body (use-package-with-elapsed-timer (format "Configuring package %s" name-symbol) |