Recognize single-character envvars in doom-load-envvars-file

And preserve insertion order for process-environment's new value.
This commit is contained in:
Henrik Lissner 2019-11-07 21:35:04 -05:00
parent d78d584fdf
commit d683effd23
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -438,7 +438,7 @@ in interactive sessions, nil otherwise (but logs a warning)."
(save-excursion (save-excursion
(insert "\n") (insert "\n")
(insert-file-contents file)) (insert-file-contents file))
(while (re-search-forward "\n *\\([^#][^= \n]+\\)=" nil t) (while (re-search-forward "\n *\\([^#][^= \n]*\\)=" nil t)
(push (buffer-substring (push (buffer-substring
(match-beginning 1) (match-beginning 1)
(1- (or (save-excursion (1- (or (save-excursion
@ -448,12 +448,12 @@ in interactive sessions, nil otherwise (but logs a warning)."
environment))) environment)))
(when environment (when environment
(setq-default (setq-default
process-environment environment process-environment (nreverse environment)
exec-path (append (parse-colon-path (getenv "PATH")) exec-path (append (parse-colon-path (getenv "PATH"))
(list exec-directory)) (list exec-directory))
shell-file-name (or (getenv "SHELL") shell-file-name (or (getenv "SHELL")
shell-file-name)) shell-file-name))
t)))) process-environment))))
(defun doom-initialize (&optional force-p) (defun doom-initialize (&optional force-p)
"Bootstrap Doom, if it hasn't already (or if FORCE-P is non-nil). "Bootstrap Doom, if it hasn't already (or if FORCE-P is non-nil).