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.
|
||||
`(eval-after-load ',package ',(macroexp-progn body))))
|
||||
(let ((p (car package)))
|
||||
(cond ((not (keywordp p))
|
||||
`(after! (:and ,@package) ,@body))
|
||||
((memq p '(:or :any))
|
||||
(cond ((memq p '(:or :any))
|
||||
(macroexp-progn
|
||||
(cl-loop for next in (cdr package)
|
||||
collect `(after! ,next ,@body))))
|
||||
((memq p '(:and :all))
|
||||
(dolist (next (cdr package))
|
||||
(setq body `((after! ,next ,@body))))
|
||||
(car body))))))
|
||||
(dolist (next (reverse (cdr package)) (car body))
|
||||
(setq body `((after! ,next ,@body)))))
|
||||
(`(after! (:and ,@package) ,@body))))))
|
||||
|
||||
(defun doom--handle-load-error (e target path)
|
||||
(let* ((source (file-name-sans-extension target))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue