refactor: (if|when)-let -> (if|when)-let*

With the former macros' future in the air (and likely to be targeted in
future, potentially breaking changes), I'll deal with this now than have
it bite me later.

Ref: https://lists.gnu.org/archive/html/emacs-devel/2024-10/msg00637.html
This commit is contained in:
Henrik Lissner
2024-12-07 14:35:54 -05:00
parent e3bc367ba2
commit 0a715cc3f2
43 changed files with 207 additions and 205 deletions

View File

@ -191,9 +191,9 @@
;;; Fix $HOME on Windows
;; $HOME isn't normally defined on Windows, but many unix tools expect it.
(when doom--system-windows-p
(when-let (realhome
(and (null (getenv-internal "HOME"))
(getenv "USERPROFILE")))
(when-let* ((realhome
(and (null (getenv-internal "HOME"))
(getenv "USERPROFILE"))))
(setenv "HOME" realhome)
(setq abbreviated-home-dir nil)))
@ -221,7 +221,7 @@
"The time it took, in seconds (as a float), for Doom Emacs to start up.")
(defconst doom-profile
(if-let (profile (getenv-internal "DOOMPROFILE"))
(if-let* ((profile (getenv-internal "DOOMPROFILE")))
(save-match-data
(if (string-match "^\\([^@]+\\)@\\(.+\\)$" profile)
(cons (match-string 1 profile)
@ -244,7 +244,7 @@
(defvar doom-user-dir
(expand-file-name
(if-let (doomdir (getenv-internal "DOOMDIR"))
(if-let* ((doomdir (getenv-internal "DOOMDIR")))
(file-name-as-directory doomdir)
(or (let ((xdgdir
(file-name-concat
@ -280,7 +280,7 @@ slash.")
;; DEPRECATED: .local will be removed entirely in 3.0
(defvar doom-local-dir
(if-let (localdir (getenv-internal "DOOMLOCALDIR"))
(if-let* ((localdir (getenv-internal "DOOMLOCALDIR")))
(expand-file-name (file-name-as-directory localdir))
(expand-file-name ".local/" doom-emacs-dir))
"Root directory for local storage.