predicate cookies: restrict to first 3 lines + set load-file-name

This commit is contained in:
Henrik Lissner 2017-11-16 16:34:42 +01:00
parent a41c651853
commit f21c01fce2
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395

View File

@ -495,8 +495,10 @@ loads MODULE SUBMODULE's packages.el file."
"Returns the value of the ;;;###if predicate form in FILE."
(with-temp-buffer
(insert-file-contents-literally file nil 0 256)
(if (re-search-forward "^;;;###if " nil t)
(eval (sexp-at-point))
(if (and (re-search-forward "^;;;###if " nil t)
(<= (line-number-at-pos) 3))
(let ((load-file-name file))
(eval (sexp-at-point)))
t)))
(defun doom-packages--async-run (fn)