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.
This commit is contained in:
Henrik Lissner 2020-06-13 17:01:34 -04:00
parent 10f5916298
commit 002bf84f45
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -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)))