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.
: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'
;; 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)