refactor: s/when-let/when-let*/

The former is deprecated on Emacs 31 for the latter.
This commit is contained in:
Henrik Lissner 2026-03-09 03:25:16 -04:00
parent 0b1de48daa
commit 4fe1cbeddb
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
70 changed files with 210 additions and 210 deletions

View file

@ -12,9 +12,9 @@ for the package.json file, and defaults to the current buffer's project root."
(or (and (not refresh-p)
(gethash project-root +javascript-npm-conf))
(let ((package-file (expand-file-name "package.json" project-root)))
(when-let (json (and (file-exists-p package-file)
(require 'json)
(json-read-file package-file)))
(when-let* ((json (and (file-exists-p package-file)
(require 'json)
(json-read-file package-file))))
(puthash project-root json +javascript-npm-conf))))))
;;;###autoload
@ -23,8 +23,8 @@ for the package.json file, and defaults to the current buffer's project root."
This value is cached unless REFRESH-P is non-nil. If PROJECT-ROOT is omitted,
the current buffer's project root is used."
(when-let (data (and (bound-and-true-p +javascript-npm-mode)
(+javascript-npm-conf project-root refresh-p)))
(when-let* ((data (and (bound-and-true-p +javascript-npm-mode)
(+javascript-npm-conf project-root refresh-p))))
(let ((deps (append (cdr (assq 'dependencies data))
(cdr (assq 'devDependencies data)))))
(cond ((listp packages)
@ -40,9 +40,9 @@ the current buffer's project root is used."
;;;###autoload
(defun +javascript-add-npm-path-h ()
"Add node_modules/.bin to `exec-path'."
(when-let ((search-directory (or (doom-project-root) default-directory))
(node-modules-parent (locate-dominating-file search-directory "node_modules/"))
(node-modules-dir (expand-file-name "node_modules/.bin/" node-modules-parent)))
(when-let* ((search-directory (or (doom-project-root) default-directory))
(node-modules-parent (locate-dominating-file search-directory "node_modules/"))
(node-modules-dir (expand-file-name "node_modules/.bin/" node-modules-parent)))
(make-local-variable 'exec-path)
(add-to-list 'exec-path node-modules-dir)
(doom-log ":lang:javascript: add %s to $PATH" (expand-file-name "node_modules/" node-modules-parent))))