Fix void-variable errors from defer-until! macro

This commit is contained in:
Henrik Lissner 2018-06-28 12:31:37 +02:00
parent 08beff91da
commit e76e4a1f75
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -226,12 +226,12 @@ MATCH is a string regexp. Only entries that match it will be included."
"Run BODY when CONDITION is true (checks on `after-load-functions'). Meant to "Run BODY when CONDITION is true (checks on `after-load-functions'). Meant to
serve as a predicated alternative to `after!'." serve as a predicated alternative to `after!'."
(declare (indent defun) (debug t)) (declare (indent defun) (debug t))
`(if ,(cadr targets) `(if ,condition
(progn ,@body) (progn ,@body)
,(let ((fun (gensym "doom|delay-form-"))) ,(let ((fun (gensym "doom|delay-form-")))
`(progn `(progn
(fset ',fun (lambda (&rest args) (fset ',fun (lambda (&rest args)
(when ,(or (car (cdr-safe targets)) t) (when ,(or condition t)
(remove-hook 'after-load-functions #',fun) (remove-hook 'after-load-functions #',fun)
(unintern ',fun nil) (unintern ',fun nil)
(ignore args) (ignore args)