mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
refactor: deprecate letenv!
`letenv!` is a layover from the days before `with-environment-variables` (introduced in 28.x), and it remained afterwards because I preferred the shorter name. From v3 and onward, Doom's core will be put on a diet which, among other things, will include culling redundant or superfluous functions/macros like this one.
This commit is contained in:
@ -825,10 +825,11 @@ However, in batch mode, print to stdout instead of stderr."
|
|||||||
(defadvice! doom-cli--straight-ignore-gitconfig-a (fn &rest args)
|
(defadvice! doom-cli--straight-ignore-gitconfig-a (fn &rest args)
|
||||||
"Prevent user and system git configuration from interfering with git calls."
|
"Prevent user and system git configuration from interfering with git calls."
|
||||||
:around #'straight--process-call
|
:around #'straight--process-call
|
||||||
(letenv! (("GIT_CONFIG" nil)
|
(with-environment-variables
|
||||||
("GIT_CONFIG_NOSYSTEM" "1")
|
(("GIT_CONFIG" nil)
|
||||||
("GIT_CONFIG_GLOBAL" (or (getenv "DOOMGITCONFIG")
|
("GIT_CONFIG_NOSYSTEM" "1")
|
||||||
"/dev/null")))
|
("GIT_CONFIG_GLOBAL" (or (getenv "DOOMGITCONFIG")
|
||||||
|
"/dev/null")))
|
||||||
(apply fn args)))
|
(apply fn args)))
|
||||||
|
|
||||||
;; If the repo failed to clone correctly (usually due to a connection failure),
|
;; If the repo failed to clone correctly (usually due to a connection failure),
|
||||||
|
@ -389,8 +389,7 @@ TRIGGER-HOOK is a list of quoted hooks and/or sharp-quoted functions."
|
|||||||
(let (file-name-handler-alist)
|
(let (file-name-handler-alist)
|
||||||
(file-name-directory (macroexpand '(file!)))))
|
(file-name-directory (macroexpand '(file!)))))
|
||||||
|
|
||||||
;; REVIEW Should I deprecate this? The macro's name is so long...
|
(define-obsolete-function-alias 'letenv! 'with-environment-variables "3.0.0")
|
||||||
(defalias 'letenv! 'with-environment-variables)
|
|
||||||
|
|
||||||
(put 'defun* 'lisp-indent-function 'defun)
|
(put 'defun* 'lisp-indent-function 'defun)
|
||||||
(defmacro letf! (bindings &rest body)
|
(defmacro letf! (bindings &rest body)
|
||||||
|
@ -249,10 +249,11 @@ However, in batch mode, print to stdout instead of stderr."
|
|||||||
(defadvice! doom-straight--ignore-gitconfig-a (fn &rest args)
|
(defadvice! doom-straight--ignore-gitconfig-a (fn &rest args)
|
||||||
"Prevent user and system git configuration from interfering with git calls."
|
"Prevent user and system git configuration from interfering with git calls."
|
||||||
:around #'straight--process-call
|
:around #'straight--process-call
|
||||||
(letenv! (("GIT_CONFIG" nil)
|
(with-environment-variables
|
||||||
("GIT_CONFIG_NOSYSTEM" "1")
|
(("GIT_CONFIG" nil)
|
||||||
("GIT_CONFIG_GLOBAL" (or (getenv "DOOMGITCONFIG")
|
("GIT_CONFIG_NOSYSTEM" "1")
|
||||||
"/dev/null")))
|
("GIT_CONFIG_GLOBAL" (or (getenv "DOOMGITCONFIG")
|
||||||
|
"/dev/null")))
|
||||||
(apply fn args)))
|
(apply fn args)))
|
||||||
|
|
||||||
;; If the repo failed to clone correctly (usually due to a connection failure),
|
;; If the repo failed to clone correctly (usually due to a connection failure),
|
||||||
|
@ -38,12 +38,13 @@
|
|||||||
(setq doom-bin "doom.ps1"))
|
(setq doom-bin "doom.ps1"))
|
||||||
;; Ensure the bin/doom operates with the same environment as this
|
;; Ensure the bin/doom operates with the same environment as this
|
||||||
;; running session.
|
;; running session.
|
||||||
(letenv! (("PATH" (string-join exec-path path-separator))
|
(with-environment-variables
|
||||||
("EMACS" (doom-path invocation-directory invocation-name))
|
(("PATH" (string-join exec-path path-separator))
|
||||||
("EMACSDIR" doom-emacs-dir)
|
("EMACS" (doom-path invocation-directory invocation-name))
|
||||||
("DOOMDIR" doom-user-dir)
|
("EMACSDIR" doom-emacs-dir)
|
||||||
("DOOMLOCALDIR" doom-local-dir)
|
("DOOMDIR" doom-user-dir)
|
||||||
("DEBUG" (if doom-debug-mode (number-to-string doom-log-level) "")))
|
("DOOMLOCALDIR" doom-local-dir)
|
||||||
|
("DEBUG" (if doom-debug-mode (number-to-string doom-log-level) "")))
|
||||||
(with-current-buffer
|
(with-current-buffer
|
||||||
(compile (format ,command (expand-file-name doom-bin doom-bin-dir)) t)
|
(compile (format ,command (expand-file-name doom-bin doom-bin-dir)) t)
|
||||||
(let ((w (get-buffer-window (current-buffer))))
|
(let ((w (get-buffer-window (current-buffer))))
|
||||||
|
@ -58,10 +58,11 @@ package's name as a symbol, and whose CDR is the plist supplied to its
|
|||||||
;;; Package management API
|
;;; Package management API
|
||||||
|
|
||||||
(defun doom--ensure-straight (recipe pin)
|
(defun doom--ensure-straight (recipe pin)
|
||||||
(letenv! (("GIT_CONFIG" nil)
|
(with-environment-variables
|
||||||
("GIT_CONFIG_NOSYSTEM" "1")
|
(("GIT_CONFIG" nil)
|
||||||
("GIT_CONFIG_GLOBAL" (or (getenv "DOOMGITCONFIG")
|
("GIT_CONFIG_NOSYSTEM" "1")
|
||||||
"/dev/null")))
|
("GIT_CONFIG_GLOBAL" (or (getenv "DOOMGITCONFIG")
|
||||||
|
"/dev/null")))
|
||||||
(let ((repo-dir (doom-path straight-base-dir "straight/repos/straight.el"))
|
(let ((repo-dir (doom-path straight-base-dir "straight/repos/straight.el"))
|
||||||
(repo-url (concat "http" (if gnutls-verify-error "s")
|
(repo-url (concat "http" (if gnutls-verify-error "s")
|
||||||
"://github.com/"
|
"://github.com/"
|
||||||
|
@ -49,9 +49,10 @@
|
|||||||
|
|
||||||
(defun doom--sandbox-run (&optional mode)
|
(defun doom--sandbox-run (&optional mode)
|
||||||
"TODO"
|
"TODO"
|
||||||
(letenv! (("DOOMDIR" (if (eq mode 'vanilla-doom+)
|
(with-environment-variables
|
||||||
(expand-file-name "___does_not_exist___" temporary-file-directory)
|
(("DOOMDIR" (if (eq mode 'vanilla-doom+)
|
||||||
doom-user-dir)))
|
(expand-file-name "___does_not_exist___" temporary-file-directory)
|
||||||
|
doom-user-dir)))
|
||||||
(doom--sandbox-launch
|
(doom--sandbox-launch
|
||||||
(unless (memq mode '(doom vanilla-doom+)) '("-Q"))
|
(unless (memq mode '(doom vanilla-doom+)) '("-Q"))
|
||||||
(let ((forms
|
(let ((forms
|
||||||
|
Reference in New Issue
Block a user