;;; :after
;;
- (defalias 'use-package-normalize/:after 'use-package-normalize-symlist)
+ (defalias 'use-package-normalize/:after 'use-package-normalize-recursive-symlist)
-(defun use-package-require-after-load (features)
+(defun use-package-require-after-load
- (features name &optional deferred-install)
++ (features)
"Return form for after any of FEATURES require NAME."
- `(progn
- ,@(mapcar
- (lambda (feat)
- `(eval-after-load
- (quote ,feat)
- ,(macroexp-progn
- `(,@(when deferred-install
- `((use-package-install-deferred-package
- ',name :after)))
- '(require ',name nil t)))))
- features)))
+ (pcase features
+ ((and (pred symbolp) feat)
+ `(lambda (body)
+ (list 'eval-after-load (list 'quote ',feat)
+ (list 'quote body))))
+ (`(,(or :or :any) . ,rest)
+ `(lambda (body)
+ (append (list 'progn)
+ (mapcar (lambda (form)
+ (funcall form body))
+ (list ,@(use-package-require-after-load rest))))))
+ (`(,(or :and :all) . ,rest)
+ `(lambda (body)
+ (let ((result body))
+ (dolist (form (list ,@(use-package-require-after-load rest)))
+ (setq result (funcall form result)))
+ result)))
+ (`(,feat . ,rest)
+ (if rest
+ (cons (use-package-require-after-load feat)
+ (use-package-require-after-load rest))
+ (list (use-package-require-after-load feat))))))
(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)))
+ (if (and (consp arg)
+ (not (memq (car arg) '(:or :any :and :all))))
+ (setq arg (cons :all arg)))
(use-package-concat
(when arg
- (list (use-package-require-after-load
- ;; Here we are checking the marker value for deferred
- ;; installation set in `use-package-handler/:ensure'.
- ;; See also `use-package-handler/:defer-install'.
- arg name (eq (plist-get state :defer-install) :ensure))))
+ (list (funcall (use-package-require-after-load arg)
- `(require (quote ,name) nil t))))
++ (macroexp-progn
++ ;; Here we are checking the marker value for deferred
++ ;; installation set in `use-package-handler/:ensure'.
++ ;; See also `use-package-handler/:defer-install'.
++ `(,@(when (eq (plist-get state :defer-install) :ensure)
++ `((use-package-install-deferred-package
++ 'name :after)))
++ '(require (quote ,name) nil t))))))
body)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(unless (or (null config-body) (equal config-body '(t)))
`((eval-after-load ,(if (symbolp name) `',name name)
',(macroexp-progn config-body))))
- (use-package-install-deferred-package name 'no-prompt :config))
+ ;; Here we are checking the marker value for deferred
+ ;; installation set in `use-package-handler/:ensure'. See also
+ ;; `use-package-handler/:defer-install'.
+ (when (eq (plist-get state :defer-install) :ensure)
++ (use-package-install-deferred-package name :config))
(use-package--with-elapsed-timer
(format "Loading package %s" name)
(if use-package-expand-minimally