fix(lib): preserve package order in after! macro
Prior to this, (after! (a b) ...) would expand to (after! b (after! a ...)) After this, it expands to (after! a (after! b ...)) This fixes load order issues with packages whose deferred configs are nested, such as org and ob-ditaa. Ref https://www.reddit.com/r/emacs/comments/pp3sye/hd311nz
This commit is contained in:
parent
650f7a82e3
commit
2c5cc752ff
1 changed files with 4 additions and 6 deletions
|
@ -378,16 +378,14 @@ This is a wrapper around `eval-after-load' that:
|
||||||
;; macros/packages.
|
;; macros/packages.
|
||||||
`(eval-after-load ',package ',(macroexp-progn body))))
|
`(eval-after-load ',package ',(macroexp-progn body))))
|
||||||
(let ((p (car package)))
|
(let ((p (car package)))
|
||||||
(cond ((not (keywordp p))
|
(cond ((memq p '(:or :any))
|
||||||
`(after! (:and ,@package) ,@body))
|
|
||||||
((memq p '(:or :any))
|
|
||||||
(macroexp-progn
|
(macroexp-progn
|
||||||
(cl-loop for next in (cdr package)
|
(cl-loop for next in (cdr package)
|
||||||
collect `(after! ,next ,@body))))
|
collect `(after! ,next ,@body))))
|
||||||
((memq p '(:and :all))
|
((memq p '(:and :all))
|
||||||
(dolist (next (cdr package))
|
(dolist (next (reverse (cdr package)) (car body))
|
||||||
(setq body `((after! ,next ,@body))))
|
(setq body `((after! ,next ,@body)))))
|
||||||
(car body))))))
|
(`(after! (:and ,@package) ,@body))))))
|
||||||
|
|
||||||
(defun doom--handle-load-error (e target path)
|
(defun doom--handle-load-error (e target path)
|
||||||
(let* ((source (file-name-sans-extension target))
|
(let* ((source (file-name-sans-extension target))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue