eval-after-load -> with-eval-after-load

The way Doom was using eval-after-load ensured its form were never
byte-compiled or even checked by the byte-compiler, because they were
treated as quoted forms (data), and thus eval'ed.

Friends don't let friends use eval.
This commit is contained in:
Henrik Lissner 2018-06-20 02:08:34 +02:00
parent 9f9b7ad792
commit 5cb1d5d4c9
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -232,7 +232,8 @@ compilation. This will no-op on features that have been disabled by the user."
(put ',fun 'permanent-local-hook t) (put ',fun 'permanent-local-hook t)
(add-hook 'after-load-functions #',fun))))) (add-hook 'after-load-functions #',fun)))))
((symbolp targets) ((symbolp targets)
`(eval-after-load ',targets '(progn ,@body))) `(with-eval-after-load ',targets
,@body))
((and (consp targets) ((and (consp targets)
(memq (car targets) '(:or :any))) (memq (car targets) '(:or :any)))
`(progn `(progn