From 61ff5a4421a1413f7e3e6937cd93c19d4592164e Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 10 Aug 2022 14:10:08 +0200 Subject: [PATCH] refactor(cli): set __DOOMCONTEXT at runtime Addresses the edge case where the user sets (or unsets) __DOOMCONTEXT in their CLI config. --- lisp/doom-cli-lib.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/doom-cli-lib.el b/lisp/doom-cli-lib.el index b451122d6..995baa6ed 100644 --- a/lisp/doom-cli-lib.el +++ b/lisp/doom-cli-lib.el @@ -1144,7 +1144,6 @@ Emacs' batch library lacks an implementation of the exec system call." (convert-buffer doom-cli-context-stderr)) (prin1 newcontext (current-buffer)))) (set-file-modes context-file #o400) - (setenv "__DOOMCONTEXT" context-file) (make-directory (file-name-directory script-file) t) (let ((coding-system-for-write 'utf-8-auto) (persistent-files (combine-and-quote-strings (delq nil (list script-file context-file)))) @@ -1163,6 +1162,7 @@ Emacs' batch library lacks an implementation of the exec system call." "_doomcleanup() {\n rm -f " persistent-files "\n}\n" "_doomrun() {\n " command "\n}\n" (string-join env " \\\n") + "__DOOMCONTEXT=" (shell-quote-argument context-file) " \\\n" (format "PATH=\"%s%s$PATH\" \\\n" (doom-path doom-emacs-dir "bin") path-separator)