diff --git a/lisp/cli/packages.el b/lisp/cli/packages.el index 6ec53f89c..7543ac66b 100644 --- a/lisp/cli/packages.el +++ b/lisp/cli/packages.el @@ -825,10 +825,11 @@ However, in batch mode, print to stdout instead of stderr." (defadvice! doom-cli--straight-ignore-gitconfig-a (fn &rest args) "Prevent user and system git configuration from interfering with git calls." :around #'straight--process-call - (letenv! (("GIT_CONFIG" nil) - ("GIT_CONFIG_NOSYSTEM" "1") - ("GIT_CONFIG_GLOBAL" (or (getenv "DOOMGITCONFIG") - "/dev/null"))) + (with-environment-variables + (("GIT_CONFIG" nil) + ("GIT_CONFIG_NOSYSTEM" "1") + ("GIT_CONFIG_GLOBAL" (or (getenv "DOOMGITCONFIG") + "/dev/null"))) (apply fn args))) ;; If the repo failed to clone correctly (usually due to a connection failure), diff --git a/lisp/doom-lib.el b/lisp/doom-lib.el index 474b64333..2c6640517 100644 --- a/lisp/doom-lib.el +++ b/lisp/doom-lib.el @@ -389,8 +389,7 @@ TRIGGER-HOOK is a list of quoted hooks and/or sharp-quoted functions." (let (file-name-handler-alist) (file-name-directory (macroexpand '(file!))))) -;; REVIEW Should I deprecate this? The macro's name is so long... -(defalias 'letenv! 'with-environment-variables) +(define-obsolete-function-alias 'letenv! 'with-environment-variables "3.0.0") (put 'defun* 'lisp-indent-function 'defun) (defmacro letf! (bindings &rest body) diff --git a/lisp/doom-straight.el b/lisp/doom-straight.el index 64593c990..1ae7776bd 100644 --- a/lisp/doom-straight.el +++ b/lisp/doom-straight.el @@ -249,10 +249,11 @@ However, in batch mode, print to stdout instead of stderr." (defadvice! doom-straight--ignore-gitconfig-a (fn &rest args) "Prevent user and system git configuration from interfering with git calls." :around #'straight--process-call - (letenv! (("GIT_CONFIG" nil) - ("GIT_CONFIG_NOSYSTEM" "1") - ("GIT_CONFIG_GLOBAL" (or (getenv "DOOMGITCONFIG") - "/dev/null"))) + (with-environment-variables + (("GIT_CONFIG" nil) + ("GIT_CONFIG_NOSYSTEM" "1") + ("GIT_CONFIG_GLOBAL" (or (getenv "DOOMGITCONFIG") + "/dev/null"))) (apply fn args))) ;; If the repo failed to clone correctly (usually due to a connection failure), diff --git a/lisp/lib/config.el b/lisp/lib/config.el index f3d7893bc..9771e8225 100644 --- a/lisp/lib/config.el +++ b/lisp/lib/config.el @@ -38,12 +38,13 @@ (setq doom-bin "doom.ps1")) ;; Ensure the bin/doom operates with the same environment as this ;; running session. - (letenv! (("PATH" (string-join exec-path path-separator)) - ("EMACS" (doom-path invocation-directory invocation-name)) - ("EMACSDIR" doom-emacs-dir) - ("DOOMDIR" doom-user-dir) - ("DOOMLOCALDIR" doom-local-dir) - ("DEBUG" (if doom-debug-mode (number-to-string doom-log-level) ""))) + (with-environment-variables + (("PATH" (string-join exec-path path-separator)) + ("EMACS" (doom-path invocation-directory invocation-name)) + ("EMACSDIR" doom-emacs-dir) + ("DOOMDIR" doom-user-dir) + ("DOOMLOCALDIR" doom-local-dir) + ("DEBUG" (if doom-debug-mode (number-to-string doom-log-level) ""))) (with-current-buffer (compile (format ,command (expand-file-name doom-bin doom-bin-dir)) t) (let ((w (get-buffer-window (current-buffer)))) diff --git a/lisp/lib/packages.el b/lisp/lib/packages.el index 6e0dfc282..b088431d6 100644 --- a/lisp/lib/packages.el +++ b/lisp/lib/packages.el @@ -58,10 +58,11 @@ package's name as a symbol, and whose CDR is the plist supplied to its ;;; Package management API (defun doom--ensure-straight (recipe pin) - (letenv! (("GIT_CONFIG" nil) - ("GIT_CONFIG_NOSYSTEM" "1") - ("GIT_CONFIG_GLOBAL" (or (getenv "DOOMGITCONFIG") - "/dev/null"))) + (with-environment-variables + (("GIT_CONFIG" nil) + ("GIT_CONFIG_NOSYSTEM" "1") + ("GIT_CONFIG_GLOBAL" (or (getenv "DOOMGITCONFIG") + "/dev/null"))) (let ((repo-dir (doom-path straight-base-dir "straight/repos/straight.el")) (repo-url (concat "http" (if gnutls-verify-error "s") "://github.com/" diff --git a/lisp/lib/sandbox.el b/lisp/lib/sandbox.el index f13516946..6a7ded7f9 100644 --- a/lisp/lib/sandbox.el +++ b/lisp/lib/sandbox.el @@ -49,9 +49,10 @@ (defun doom--sandbox-run (&optional mode) "TODO" - (letenv! (("DOOMDIR" (if (eq mode 'vanilla-doom+) - (expand-file-name "___does_not_exist___" temporary-file-directory) - doom-user-dir))) + (with-environment-variables + (("DOOMDIR" (if (eq mode 'vanilla-doom+) + (expand-file-name "___does_not_exist___" temporary-file-directory) + doom-user-dir))) (doom--sandbox-launch (unless (memq mode '(doom vanilla-doom+)) '("-Q")) (let ((forms