lang/org: fix byte-compiler using outdated, built-in org #327

During runtime, the new version of org (installed via ELPA) is added to
load-path, but this doesn't happen during compile-time. Wrap it in
eval-and-compile and that changes.
This commit is contained in:
Henrik Lissner 2018-01-05 13:32:39 -05:00
parent fab6fb1270
commit 55ad843a09
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -4,10 +4,11 @@
"The directory where org files are kept.")
;; Ensure ELPA org is prioritized above built-in org.
(when-let* ((path (locate-library "org" nil doom--base-load-path)))
(setq load-path
(delete (substring (file-name-directory path) 0 -1)
load-path)))
(eval-and-compile
(when-let* ((path (locate-library "org" nil doom--base-load-path)))
(setq load-path
(delete (substring (file-name-directory path) 0 -1)
load-path))))
;; Sub-modules
(if (featurep! +attach) (load! +attach))