1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-24 07:20:37 +00:00

Add new customization variable `use-package-deferring-keywords'

This commit is contained in:
John Wiegley 2017-12-04 00:11:46 -08:00
parent 6d51e52342
commit 0be575766c
2 changed files with 22 additions and 10 deletions

View File

@ -35,6 +35,10 @@
declaration, and the macro-expanded version (without verbosity-related
code). Note that this still does not help if there are parsing errors, which
will still cause Emacs to encounter a Lisp error at startup time.
- New customization variable `use-package-deferring-keywords`, mainly intended
for use by extension packages, indicates keywords that, if used without
`:demand`, cause deferred loading (as if `:defer t` had been specified).
- New `:hook` keyword.

View File

@ -97,6 +97,21 @@ declaration is incorrect."
:type '(repeat symbol)
:group 'use-package)
(defcustom use-package-deferring-keywords
'(:bind
:bind*
:bind-keymap
:bind-keymap*
:interpreter
:mode
:magic
:magic-fallback
:commands
:hook)
"Unless `:demand' is used, keywords in this list imply deferred loading."
:type '(repeat symbol)
:group 'use-package)
(defcustom use-package-verbose nil
"Whether to report about loading and configuration details.
If you customize this, then you should require the `use-package'
@ -499,16 +514,9 @@ This is in contrast to merely setting it to 0."
;; Certain keywords imply :defer, if :demand was not specified.
(when (and (not (plist-member args :demand))
(not (plist-member args :defer))
(or (plist-member args :bind)
(plist-member args :bind*)
(plist-member args :bind-keymap)
(plist-member args :bind-keymap*)
(plist-member args :interpreter)
(plist-member args :mode)
(plist-member args :magic)
(plist-member args :magic-fallback)
(plist-member args :commands)
(plist-member args :hook)))
(cl-some #'identity
(mapcar (apply-partially #'plist-member args)
use-package-deferring-keywords)))
(setq args (append args '(:defer t))))
(when (and (plist-member args :load)