mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-07 20:59:37 +00:00
Add new customization variable `use-package-deferring-keywords'
This commit is contained in:
parent
6d51e52342
commit
0be575766c
2 changed files with 22 additions and 10 deletions
|
@ -36,6 +36,10 @@
|
||||||
code). Note that this still does not help if there are parsing errors, which
|
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.
|
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.
|
- New `:hook` keyword.
|
||||||
|
|
||||||
- New keywords `:custom (foo1 bar1) (foo2 bar2)` etc., and `:custom-face`.
|
- New keywords `:custom (foo1 bar1) (foo2 bar2)` etc., and `:custom-face`.
|
||||||
|
|
28
up-core.el
28
up-core.el
|
@ -97,6 +97,21 @@ declaration is incorrect."
|
||||||
:type '(repeat symbol)
|
:type '(repeat symbol)
|
||||||
:group 'use-package)
|
: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
|
(defcustom use-package-verbose nil
|
||||||
"Whether to report about loading and configuration details.
|
"Whether to report about loading and configuration details.
|
||||||
If you customize this, then you should require the `use-package'
|
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.
|
;; Certain keywords imply :defer, if :demand was not specified.
|
||||||
(when (and (not (plist-member args :demand))
|
(when (and (not (plist-member args :demand))
|
||||||
(not (plist-member args :defer))
|
(not (plist-member args :defer))
|
||||||
(or (plist-member args :bind)
|
(cl-some #'identity
|
||||||
(plist-member args :bind*)
|
(mapcar (apply-partially #'plist-member args)
|
||||||
(plist-member args :bind-keymap)
|
use-package-deferring-keywords)))
|
||||||
(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)))
|
|
||||||
(setq args (append args '(:defer t))))
|
(setq args (append args '(:defer t))))
|
||||||
|
|
||||||
(when (and (plist-member args :load)
|
(when (and (plist-member args :load)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue