From 574dae14261d7666d99b5bea73d8d1442fbd8268 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 26 Feb 2019 23:31:30 -0500 Subject: [PATCH] Isolate builtin org at compile time Attempts to address the elusive "invalid-function org-preserve-local-variables" error mentioned in: #1116 #1169, and This error is otherwise avoided by running `bin/doom compile :plugins` --- modules/lang/org/packages.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/lang/org/packages.el b/modules/lang/org/packages.el index 92d2b33ad..a69d34e8b 100644 --- a/modules/lang/org/packages.el +++ b/modules/lang/org/packages.el @@ -3,7 +3,14 @@ ;; Installs a cutting-edge version of org-mode (package! org-plus-contrib) -(package! org :ignore t) ; ignore org from ELPA + +;; Prevent built-in Org from playing into the byte-compilation of +;; `org-plus-contrib'. +(when-let* ((orglib (locate-library "org" nil doom-site-load-path))) + (setq load-path (delete (substring (file-name-directory orglib) 0 -1) + load-path))) +;; Ignore org on ELPA, if possible +(package! org :ignore t) (package! org-bullets :recipe (:fetcher github :repo "Kaligule/org-bullets")) (package! org-yt :recipe (:fetcher github :repo "TobiasZawada/org-yt"))