1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 14:30:50 -08:00

Merge pull request from phillord/feature/after

Support for after keyword.
GitHub-reference: https://github.com/jwiegley/use-package/issues/276
This commit is contained in:
John Wiegley 2015-11-05 08:03:55 -05:00
commit 96add4d4c0

View file

@ -126,6 +126,7 @@ the user specified."
:defines :defines
:functions :functions
:defer :defer
:after
:demand :demand
:init :init
:config :config
@ -854,6 +855,33 @@ deferred until the prefix key sequence is pressed."
body))) body)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; :after
;;
(defalias 'use-package-normalize/:after 'use-package-normalize-symlist)
(defun use-package-require-after-load (features name)
"Return form for after any of FEATURES require NAME."
`(progn
,@(mapcar
(lambda (feat)
`(eval-after-load
(quote ,feat)
(quote (require (quote ,name)))))
features)))
(defun use-package-handler/:after (name keyword arg rest state)
(let ((body (use-package-process-keywords name rest
(plist-put state :deferred t)))
(name-string (use-package-as-string name)))
(use-package-concat
(when arg
(list (use-package-require-after-load arg name)))
body)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; :demand ;; :demand
@ -1019,6 +1047,10 @@ this file. Usage:
`:commands', `:bind', `:bind*', `:mode' or `:interpreter'. `:commands', `:bind', `:bind*', `:mode' or `:interpreter'.
This can be an integer, to force loading after N seconds of This can be an integer, to force loading after N seconds of
idle time, if the package has not already been loaded. idle time, if the package has not already been loaded.
:after Defer loading of a package until after any of the named
features are loaded.
:demand Prevent deferred loading in all cases. :demand Prevent deferred loading in all cases.
:if EXPR Initialize and load only if EXPR evaluates to a non-nil value. :if EXPR Initialize and load only if EXPR evaluates to a non-nil value.