From eacbc5e36f4ba8d8c2b92836842a18fddc5b965e Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 20 Jan 2021 22:10:31 -0500 Subject: [PATCH] Inject load-path when compiling straight packages --- core/core-cli.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/core-cli.el b/core/core-cli.el index a0fcba9d8..431c03d63 100644 --- a/core/core-cli.el +++ b/core/core-cli.el @@ -424,6 +424,17 @@ everywhere we use it (and internally)." cause) interactive))) +(defadvice! doom--straight-inject-load-path-a (orig-fn &rest args) + "Straight builds packages in an isolated Emacs child process, which " + :override #'straight--build-compile + (let* ((package (plist-get recipe :package)) + (dir (straight--build-dir package))) + (call-process (concat invocation-directory invocation-name) + nil straight-byte-compilation-buffer nil + "-Q" "--batch" + "--eval" (prin1-to-string `(setq load-path (cons ,dir ',load-path))) + "--eval" (format "(byte-recompile-directory %S 0 'force)" dir)))) + ;; ;;; Entry point