From 002bf84f458fff60b87b3e0bc1b6a8596d149698 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 13 Jun 2020 17:01:34 -0400 Subject: [PATCH] doom-load-envvars-file: only affect default state Some plugins (like envrc-mode) make process-environment, exec-path and shell-file-name buffer-local. Running `M-x doom/reload` or `doom-load-envvars-file` should affect their global values, and not their buffer local ones. --- core/core-lib.el | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/core/core-lib.el b/core/core-lib.el index 0e1383f0b..8f81997c5 100644 --- a/core/core-lib.el +++ b/core/core-lib.el @@ -113,10 +113,16 @@ unreadable. Returns the names of envvars that were changed." env (split-string (buffer-substring (match-beginning 1) (point-max)) "\0\n" 'omit-nulls)))))) - (setq process-environment (append (nreverse env) process-environment) - exec-path (append (split-string (getenv "PATH") path-separator t) - (list exec-directory)) - shell-file-name (or (getenv "SHELL") shell-file-name)) + (setq-default + process-environment + (append (nreverse env) + (default-value 'process-environment)) + exec-path + (append (split-string (getenv "PATH") path-separator t) + (list exec-directory)) + shell-file-name + (or (getenv "SHELL") + (default-value 'shell-file-name))) env)))