diff --git a/core/autoload/buffers.el b/core/autoload/buffers.el index dd75bf8f9..1f516bdc9 100644 --- a/core/autoload/buffers.el +++ b/core/autoload/buffers.el @@ -128,7 +128,7 @@ If BUFFER-OR-NAME is omitted or nil, the current buffer is tested." (or (bufferp buffer-or-name) (stringp buffer-or-name) (signal 'wrong-type-argument (list '(bufferp stringp) buffer-or-name))) - (when-let* ((buf (get-buffer buffer-or-name))) + (when-let (buf (get-buffer buffer-or-name)) (and (buffer-live-p buf) (not (doom-temp-buffer-p buf)) (or (buffer-local-value 'doom-real-buffer-p buf) diff --git a/core/autoload/files.el b/core/autoload/files.el index ffa2b3a53..da012aced 100644 --- a/core/autoload/files.el +++ b/core/autoload/files.el @@ -167,7 +167,7 @@ file if it exists, without confirmation." (list (read-file-name "Copy file to: ") current-prefix-arg)) (pcase (catch 'status - (when-let* ((dest (doom--copy-file (buffer-file-name) new-path force-p))) + (when-let (dest (doom--copy-file (buffer-file-name) new-path force-p)) (doom--update-file new-path) (message "File successfully copied to %s" dest))) (`overwrite-self (error "Cannot overwrite self")) @@ -184,7 +184,7 @@ file if it exists, without confirmation." (pcase (catch 'status (let ((old-path (buffer-file-name)) (new-path (expand-file-name new-path))) - (when-let* ((dest (doom--copy-file old-path new-path force-p))) + (when-let (dest (doom--copy-file old-path new-path force-p)) (when (file-exists-p old-path) (delete-file old-path)) (kill-current-buffer) diff --git a/core/autoload/fonts.el b/core/autoload/fonts.el index 21636ca1d..a45cafca1 100644 --- a/core/autoload/fonts.el +++ b/core/autoload/fonts.el @@ -27,7 +27,7 @@ acceptable values for this variable.") (defun doom--font-name (fontname frame) (when (query-fontset fontname) - (when-let* ((ascii (assq 'ascii (aref (fontset-info fontname frame) 2)))) + (when-let (ascii (assq 'ascii (aref (fontset-info fontname frame) 2))) (setq fontname (nth 2 ascii)))) (or (x-decompose-font-name fontname) (error "Cannot decompose font name"))) diff --git a/core/autoload/help.el b/core/autoload/help.el index abcce9566..512b1fc94 100644 --- a/core/autoload/help.el +++ b/core/autoload/help.el @@ -309,9 +309,9 @@ current file is in, or d) the module associated with the current major mode (see (when (memq (car-safe sexp) '(featurep! require!)) (format "%s %s" (nth 1 sexp) (nth 2 sexp))))))) ((and buffer-file-name - (when-let* ((mod (doom-module-from-path buffer-file-name))) + (when-let (mod (doom-module-from-path buffer-file-name)) (format "%s %s" (car mod) (cdr mod))))) - ((when-let* ((mod (cdr (assq major-mode doom--help-major-mode-module-alist)))) + ((when-let (mod (cdr (assq major-mode doom--help-major-mode-module-alist))) (format "%s %s" (symbol-name (car mod)) (symbol-name (cadr mod))))))) @@ -498,7 +498,7 @@ If prefix arg is present, refresh the cache." (defun doom--package-url (package) (cond ((assq package package--builtins) (user-error "Package is built into Emacs and cannot be looked up")) - ((when-let* ((location (locate-library (symbol-name package)))) + ((when-let (location (locate-library (symbol-name package))) (with-temp-buffer (insert-file-contents (concat (file-name-sans-extension location) ".el") nil 0 4096) diff --git a/core/cli/autoloads.el b/core/cli/autoloads.el index 6fec46c16..09a0b1a99 100644 --- a/core/cli/autoloads.el +++ b/core/cli/autoloads.el @@ -30,7 +30,7 @@ one wants that.") "Delete FILE (an autoloads file) and accompanying *.elc file, if any." (cl-check-type file string) (when (file-exists-p file) - (when-let* ((buf (find-buffer-visiting doom-autoload-file))) + (when-let (buf (find-buffer-visiting doom-autoload-file)) (with-current-buffer buf (set-buffer-modified-p nil)) (kill-buffer buf)) diff --git a/core/cli/byte-compile.el b/core/cli/byte-compile.el index 2d947a4d5..4d7533011 100644 --- a/core/cli/byte-compile.el +++ b/core/cli/byte-compile.el @@ -128,10 +128,10 @@ If RECOMPILE-P is non-nil, only recompile out-of-date files." ;; don't meet their own predicates. (push (list :no-require t (lambda (_name args) - (or (when-let* ((pred (or (plist-get args :if) - (plist-get args :when)))) + (or (when-let (pred (or (plist-get args :if) + (plist-get args :when))) (not (eval pred t))) - (when-let* ((pred (plist-get args :unless))) + (when-let (pred (plist-get args :unless)) (eval pred t))))) use-package-defaults) (dolist (target (cl-delete-duplicates (mapcar #'file-truename target-files) :test #'equal)) diff --git a/core/core-editor.el b/core/core-editor.el index 29b9f9da1..13f5e0faa 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -129,7 +129,7 @@ detected.") "Bump file in recent file list when it is switched or written to." (when buffer-file-name (recentf-add-file buffer-file-name)) - ;; Return nil to call from `write-file-functions' + ;; Return nil for `write-file-functions' nil) (add-hook 'doom-switch-window-hook #'doom|recentf-touch-buffer) (add-hook 'write-file-functions #'doom|recentf-touch-buffer) @@ -181,7 +181,7 @@ savehist file." :when (display-graphic-p) :after-call (pre-command-hook after-find-file) :init - (when-let* ((name (getenv "EMACS_SERVER_NAME"))) + (when-let (name (getenv "EMACS_SERVER_NAME")) (setq server-name name)) :config (unless (server-running-p) diff --git a/core/core-keybinds.el b/core/core-keybinds.el index 067608450..221f2cb53 100644 --- a/core/core-keybinds.el +++ b/core/core-keybinds.el @@ -98,7 +98,7 @@ If any hook returns non-nil, all hooks after it are ignored.") (push `(define-key doom-leader-map (general--kbd ,key) ,bdef) forms)) - (when-let* ((desc (cadr (memq :which-key udef)))) + (when-let (desc (cadr (memq :which-key udef))) (push `(which-key-add-key-based-replacements (general--concat t doom-leader-alt-key ,key) ,desc) diff --git a/core/core-modules.el b/core/core-modules.el index 2c2367b6c..37106f768 100644 --- a/core/core-modules.el +++ b/core/core-modules.el @@ -112,7 +112,7 @@ non-nil." (defun doom-module-get (category module &optional property) "Returns the plist for CATEGORY MODULE. Gets PROPERTY, specifically, if set." (declare (pure t) (side-effect-free t)) - (when-let* ((plist (gethash (cons category module) doom-modules))) + (when-let (plist (gethash (cons category module) doom-modules)) (if property (plist-get plist property) plist))) @@ -278,7 +278,7 @@ If ALL-P is non-nil, return paths of possible modules, activated or otherwise." (require ',name) ((debug error) (message "Failed to load deferred package %s: %s" ',name e))) - (when-let* ((deferral-list (assq ',name doom--deferred-packages-alist))) + (when-let (deferral-list (assq ',name doom--deferred-packages-alist)) (dolist (hook (cdr deferral-list)) (advice-remove hook #',fn) (remove-hook hook #',fn)) diff --git a/core/core-packages.el b/core/core-packages.el index a5c73650e..5b2263be6 100644 --- a/core/core-packages.el +++ b/core/core-packages.el @@ -133,7 +133,7 @@ them." (defun doom-ensure-core-packages () "Make sure `doom-core-packages' are installed." - (when-let* ((core-packages (cl-remove-if #'package-installed-p doom-core-packages))) + (when-let (core-packages (cl-remove-if #'package-installed-p doom-core-packages)) (message "Installing core packages") (unless doom--refreshed-p (package-refresh-contents)) diff --git a/core/core-projects.el b/core/core-projects.el index 319544130..6d28625ab 100644 --- a/core/core-projects.el +++ b/core/core-projects.el @@ -93,7 +93,7 @@ c) are not valid projectile projects." (defun doom*projectile-locate-dominating-file (orig-fn file name) "Don't traverse the file system if on a remote connection." (when (and (stringp file) - (not (file-remote-p file))) + (not (file-remote-p file nil t))) (funcall orig-fn file name))) (advice-add #'projectile-locate-dominating-file :around #'doom*projectile-locate-dominating-file) diff --git a/core/core-ui.el b/core/core-ui.el index d63c060f5..adfdc5d62 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -109,7 +109,7 @@ behavior). Do not set this directly, this is let-bound in `doom|init-theme'.") (and (eq orig-fn #'switch-to-buffer) (car args))) (apply orig-fn buffer-or-name args) (let ((doom-inhibit-switch-buffer-hooks t)) - (when-let* ((buffer (apply orig-fn buffer-or-name args))) + (when-let (buffer (apply orig-fn buffer-or-name args)) (with-current-buffer (if (windowp buffer) (window-buffer buffer) buffer) @@ -121,7 +121,7 @@ behavior). Do not set this directly, this is let-bound in `doom|init-theme'.") (if doom-inhibit-switch-buffer-hooks (apply orig-fn args) (let ((doom-inhibit-switch-buffer-hooks t)) - (when-let* ((buffer (apply orig-fn args))) + (when-let (buffer (apply orig-fn args)) (with-current-buffer buffer (run-hooks 'doom-switch-buffer-hook)) buffer))))) @@ -508,9 +508,10 @@ By default, this uses Apple Color Emoji on MacOS and Symbola on Linux." :around #'doom*run-switch-buffer-hooks)) ;; Apply `doom-theme' -(if (daemonp) - (add-hook 'after-make-frame-functions #'doom|init-theme) - (add-hook 'doom-init-ui-hook #'doom|init-theme)) +(add-hook (if (daemonp) + 'after-make-frame-functions + 'doom-init-ui-hook) + #'doom|init-theme) ;; Apply `doom-font' et co (add-hook 'doom-after-init-modules-hook #'doom|init-fonts) ;; Ensure unicode fonts are set on each frame diff --git a/core/core.el b/core/core.el index 193be22cf..b726abb45 100644 --- a/core/core.el +++ b/core/core.el @@ -318,22 +318,21 @@ intervals." (nconc doom-incremental-packages packages) (when packages (let ((gc-cons-threshold doom-gc-cons-upper-limit) + (reqs (cl-delete-if #'featurep packages)) file-name-handler-alist) - (let* ((reqs (cl-delete-if #'featurep packages)) - (req (ignore-errors (pop reqs)))) - (when req - (doom-log "Incrementally loading %s" req) - (condition-case e - (or (while-no-input (require req nil t) t) - (push req reqs)) - ((error debug) - (message "Failed to load '%s' package incrementally, because: %s" - req e))) - (if reqs - (run-with-idle-timer doom-incremental-idle-timer - nil #'doom-load-packages-incrementally - reqs t) - (doom-log "Finished incremental loading")))))))) + (when-let (req (if reqs (ignore-errors (pop reqs)))) + (doom-log "Incrementally loading %s" req) + (condition-case e + (or (while-no-input (require req nil t) t) + (push req reqs)) + ((error debug) + (message "Failed to load '%s' package incrementally, because: %s" + req e))) + (if reqs + (run-with-idle-timer doom-incremental-idle-timer + nil #'doom-load-packages-incrementally + reqs t) + (doom-log "Finished incremental loading"))))))) (defun doom|load-packages-incrementally () "Begin incrementally loading packages in `doom-incremental-packages'. @@ -433,8 +432,8 @@ in interactive sessions, nil otherwise (but logs a warning)." (if (not (file-readable-p file)) (doom-log "Couldn't read %S envvar file" file) (with-temp-buffer - (insert-file-contents file) - (re-search-forward "\n\n" nil t) + (insert-file-contents-literally file) + (search-forward "\n\n" nil t) (while (re-search-forward "\n\\([^= \n]+\\)=" nil t) (save-excursion (let ((var (match-string 1)) diff --git a/modules/app/irc/config.el b/modules/app/irc/config.el index 34be5d598..ae8780299 100644 --- a/modules/app/irc/config.el +++ b/modules/app/irc/config.el @@ -98,7 +98,7 @@ playback.") (defun +irc*circe-truncate-nicks () "Truncate long nicknames in chat output non-destructively." - (when-let* ((beg (text-property-any (point-min) (point-max) 'lui-format-argument 'nick))) + (when-let (beg (text-property-any (point-min) (point-max) 'lui-format-argument 'nick)) (goto-char beg) (let ((end (next-single-property-change beg 'lui-format-argument)) (nick (plist-get (plist-get (text-properties-at beg) 'lui-keywords) diff --git a/modules/app/regex/autoload/regex.el b/modules/app/regex/autoload/regex.el index 1c64490fe..0df6b7994 100644 --- a/modules/app/regex/autoload/regex.el +++ b/modules/app/regex/autoload/regex.el @@ -259,7 +259,7 @@ __DATA__ (overlay-put ov 'category '+regex)) (cl-incf i) (dotimes (i 10) - (when-let* ((text (match-string i))) + (when-let (text (match-string i)) (save-match-data (with-current-buffer +regex--groups-buffer (goto-char (point-max)) diff --git a/modules/app/rss/autoload.el b/modules/app/rss/autoload.el index bee317f78..1fa6b498a 100644 --- a/modules/app/rss/autoload.el +++ b/modules/app/rss/autoload.el @@ -71,7 +71,7 @@ (show-buffers (doom-buffers-in-mode 'elfeed-show-mode)) kill-buffer-query-functions) (dolist (file +rss-elfeed-files) - (when-let* ((buf (get-file-buffer (expand-file-name file org-directory)))) + (when-let (buf (get-file-buffer (expand-file-name file org-directory))) (kill-buffer buf))) (dolist (b search-buffers) (with-current-buffer b diff --git a/modules/completion/ivy/autoload/ivy.el b/modules/completion/ivy/autoload/ivy.el index b2792886b..ab439eef4 100644 --- a/modules/completion/ivy/autoload/ivy.el +++ b/modules/completion/ivy/autoload/ivy.el @@ -183,9 +183,9 @@ If ARG (universal argument), open selection in other-window." (task-tags (mapcar #'car +ivy-task-tags)) (cmd (format "%s -H -S --no-heading -- %s %s" - (or (when-let* ((bin (executable-find "rg"))) + (or (when-let (bin (executable-find "rg")) (concat bin " --line-number")) - (when-let* ((bin (executable-find "ag"))) + (when-let (bin (executable-find "ag")) (concat bin " --numbers")) (error "ripgrep & the_silver_searcher are unavailable")) (shell-quote-argument @@ -306,7 +306,7 @@ The point of this is to avoid Emacs locking up indexing massive file trees." (interactive) (call-interactively (cond ((or (file-equal-p default-directory "~") - (when-let* ((proot (doom-project-root))) + (when-let (proot (doom-project-root)) (file-equal-p proot "~"))) #'counsel-find-file) diff --git a/modules/editor/evil/autoload/advice.el b/modules/editor/evil/autoload/advice.el index a02ac332a..4b573b10f 100644 --- a/modules/editor/evil/autoload/advice.el +++ b/modules/editor/evil/autoload/advice.el @@ -124,7 +124,7 @@ more information on modifiers." (file-relative-name parent))))) ("s" (if (featurep 'evil) - (when-let* ((args (evil-delimited-arguments (substring flag 1) 2))) + (when-let (args (evil-delimited-arguments (substring flag 1) 2)) (let ((pattern (evil-transform-vim-style-regexp (car args))) (replace (cadr args))) (replace-regexp-in-string diff --git a/modules/editor/snippets/autoload/snippets.el b/modules/editor/snippets/autoload/snippets.el index 15a7c0b63..497d209bb 100644 --- a/modules/editor/snippets/autoload/snippets.el +++ b/modules/editor/snippets/autoload/snippets.el @@ -33,7 +33,9 @@ ignored. This makes it easy to override built-in snippets with private ones." (interactive) (let* ((snippet (car (yas-active-snippets))) (active-field (yas--snippet-active-field snippet)) - (position (if (yas--field-p active-field) (yas--field-start active-field) -1))) + (position (if (yas--field-p active-field) + (yas--field-start active-field) + -1))) (if (= (point) position) (move-beginning-of-line 1) (goto-char position)))) @@ -44,7 +46,9 @@ ignored. This makes it easy to override built-in snippets with private ones." (interactive) (let* ((snippet (car (yas-active-snippets))) (active-field (yas--snippet-active-field snippet)) - (position (if (yas--field-p active-field) (yas--field-end active-field) -1))) + (position (if (yas--field-p active-field) + (yas--field-end active-field) + -1))) (if (= (point) position) (move-end-of-line 1) (goto-char position)))) diff --git a/modules/email/mu4e/autoload/email.el b/modules/email/mu4e/autoload/email.el index feb14c9ea..e2636355d 100644 --- a/modules/email/mu4e/autoload/email.el +++ b/modules/email/mu4e/autoload/email.el @@ -19,7 +19,7 @@ OPTIONAL: DEFAULT-P is a boolean. If non-nil, it marks that email account as the default/fallback account." (after! mu4e - (when-let* ((address (cdr (assq 'user-mail-address letvars)))) + (when-let (address (cdr (assq 'user-mail-address letvars))) (add-to-list 'mu4e-user-mail-address-list address)) (setq mu4e-contexts (cl-loop for context in mu4e-contexts diff --git a/modules/lang/cc/autoload.el b/modules/lang/cc/autoload.el index e50ea0665..4daf46a24 100644 --- a/modules/lang/cc/autoload.el +++ b/modules/lang/cc/autoload.el @@ -173,7 +173,7 @@ compilation dbs." ;; (defun +cc|init-ccls-compile-options () ;; "TODO" ;; (when (memq major-mode '(c-mode c++-mode objc-mode)) -;; (when-let* ((include-paths (+cc-resolve-include-paths))) +;; (when-let (include-paths (+cc-resolve-include-paths)) ;; (let ((args (delq nil (cdr-safe (assq major-mode +cc-default-compiler-options))))) ;; (setf (alist-get (or (lsp-workspace-root) ;; (lsp--suggest-project-root) @@ -190,10 +190,10 @@ compilation dbs." "Takes the local project include paths and registers them with ffap. This way, `find-file-at-point' (and `+lookup/file') will know where to find most header files." - (when-let* ((project-root (or (bound-and-true-p irony--working-directory) - (and (featurep 'lsp) - (or (lsp-workspace-root) - (doom-project-root)))))) + (when-let (project-root (or (bound-and-true-p irony--working-directory) + (and (featurep 'lsp) + (or (lsp-workspace-root) + (doom-project-root))))) (require 'ffap) (make-local-variable 'ffap-c-path) (make-local-variable 'ffap-c++-path) diff --git a/modules/lang/javascript/autoload.el b/modules/lang/javascript/autoload.el index e6a27a4e1..2226b536c 100644 --- a/modules/lang/javascript/autoload.el +++ b/modules/lang/javascript/autoload.el @@ -10,15 +10,15 @@ ignore the cache." (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 (defun +javascript-npm-dep-p (packages &optional project-root refresh-p) - (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) diff --git a/modules/lang/lua/autoload.el b/modules/lang/lua/autoload.el index 0100d1808..8b303e3c6 100644 --- a/modules/lang/lua/autoload.el +++ b/modules/lang/lua/autoload.el @@ -11,7 +11,7 @@ (defun +lua/run-love-game () "Run the current project with Love2D." (interactive) - (when-let* ((root (locate-dominating-file buffer-file-name "main.lua"))) + (when-let (root (locate-dominating-file buffer-file-name "main.lua")) (async-shell-command (format "%s %s" (or (executable-find "love") diff --git a/modules/lang/markdown/autoload.el b/modules/lang/markdown/autoload.el index 073d4dedb..c0445c35e 100644 --- a/modules/lang/markdown/autoload.el +++ b/modules/lang/markdown/autoload.el @@ -89,8 +89,8 @@ exit code." (defun +markdown-compile-markdown (beg end output-buffer) "Compiles markdown using the Markdown.pl script (or markdown executable), if available. Returns its exit code." - (when-let* ((exe (or (executable-find "Markdown.pl") - (executable-find "markdown")))) + (when-let (exe (or (executable-find "Markdown.pl") + (executable-find "markdown"))) (call-process-region beg end shell-file-name nil output-buffer nil shell-command-switch diff --git a/modules/lang/org/autoload/org.el b/modules/lang/org/autoload/org.el index 954be6cff..1002b57d2 100644 --- a/modules/lang/org/autoload/org.el +++ b/modules/lang/org/autoload/org.el @@ -124,7 +124,7 @@ If on a: (org-table-blank-field) (org-table-recalculate) (when (and (string-empty-p (string-trim (org-table-get-field))) - (bound-and-true-p evil-mode)) + (bound-and-true-p evil-local-mode)) (evil-change-state 'insert))) (`babel-call @@ -226,7 +226,7 @@ wrong places)." (save-excursion (insert "\n") (if (= level 1) (insert "\n"))))) - (when-let* ((todo-keyword (org-element-property :todo-keyword context))) + (when-let (todo-keyword (org-element-property :todo-keyword context)) (org-todo (or (car (+org-get-todo-keywords-for todo-keyword)) 'todo))))) @@ -234,7 +234,7 @@ wrong places)." (when (org-invisible-p) (org-show-hidden-entry)) - (when (bound-and-true-p evil-mode) + (when (bound-and-true-p evil-local-mode) (evil-insert 1)))) ;;;###autoload @@ -365,8 +365,8 @@ another level of headings on each invocation." "Indent the current item (header or item), if possible. Made for `org-tab-first-hook' in evil-mode." (interactive) - (cond ((or (not (bound-and-true-p evil-mode)) - (not (eq evil-state 'insert))) + (cond ((not (and (bound-and-true-p evil-local-mode) + (evil-insert-state-p))) nil) ((org-at-item-p) (if (eq this-command 'org-shifttab) @@ -505,6 +505,6 @@ an effect when `evil-org-special-o/O' has `item' in it (not the default)." ;;;###autoload (defun +org*display-link-in-eldoc (orig-fn &rest args) "Display the link at point in eldoc." - (or (when-let* ((link (org-element-property :raw-link (org-element-context)))) + (or (when-let (link (org-element-property :raw-link (org-element-context))) (format "Link: %s" link)) (apply orig-fn args))) diff --git a/modules/lang/php/autoload.el b/modules/lang/php/autoload.el index 012d7e0b3..0cd8a68a5 100644 --- a/modules/lang/php/autoload.el +++ b/modules/lang/php/autoload.el @@ -20,9 +20,9 @@ ignore the cache." (let ((project-root (or project-root (doom-project-root)))) (or (and (not refresh-p) (gethash project-root +php-composer-conf)) (let ((package-file (expand-file-name "composer.json" project-root))) - (when-let* ((data (and (file-exists-p package-file) - (require 'json) - (json-read-file package-file)))) + (when-let (data (and (file-exists-p package-file) + (require 'json) + (json-read-file package-file))) (puthash project-root data +php-composer-conf)))))) ;;;###autoload diff --git a/modules/lang/python/autoload/conda.el b/modules/lang/python/autoload/conda.el index f0b78b5c2..b11a43760 100644 --- a/modules/lang/python/autoload/conda.el +++ b/modules/lang/python/autoload/conda.el @@ -11,7 +11,7 @@ can use a remote conda environment, including the corresponding remote python executable and packages." (interactive) (require 'conda) - (when-let* ((home (read-directory-name "Set conda home: " "~" nil nil conda-anaconda-home))) + (when-let (home (read-directory-name "Set conda home: " "~" nil nil conda-anaconda-home)) (setq conda-anaconda-home home) (message "Successfully changed conda home to: %s" (abbreviate-file-name home)))) diff --git a/modules/lang/python/autoload/python.el b/modules/lang/python/autoload/python.el index 7a014560b..763bf0886 100644 --- a/modules/lang/python/autoload/python.el +++ b/modules/lang/python/autoload/python.el @@ -50,6 +50,6 @@ (let ((bin (expand-file-name (concat conda-env-current-name "/" exe-root) (conda-env-default-location)))) (if (file-executable-p bin) bin)))) - ((when-let* ((bin (projectile-locate-dominating-file default-directory "bin/python"))) + ((when-let (bin (projectile-locate-dominating-file default-directory "bin/python")) (setq-local doom-modeline-python-executable (expand-file-name "bin/python" bin)))) ((executable-find exe)))))) diff --git a/modules/term/eshell/autoload/eshell.el b/modules/term/eshell/autoload/eshell.el index eece73c1a..92bc991d2 100644 --- a/modules/term/eshell/autoload/eshell.el +++ b/modules/term/eshell/autoload/eshell.el @@ -16,7 +16,7 @@ (ring-remove+insert+extend +eshell-buffers buf 'grow)) (defun +eshell--remove-buffer (buf) - (when-let* ((idx (ring-member +eshell-buffers buf))) + (when-let (idx (ring-member +eshell-buffers buf)) (ring-remove +eshell-buffers idx) t)) @@ -26,7 +26,7 @@ (when (eq major-mode 'eshell-mode) (switch-to-buffer (doom-fallback-buffer))) (when +eshell-enable-new-shell-on-split - (when-let* ((win (get-buffer-window (+eshell/here)))) + (when-let (win (get-buffer-window (+eshell/here))) (set-window-dedicated-p win dedicated-p)))) (defun +eshell--setup-window (window &optional flag) @@ -284,7 +284,7 @@ delete." "Close window (or workspace) on quit." (let ((buf (current-buffer))) (when (+eshell--remove-buffer buf) - (when-let* ((win (get-buffer-window buf))) + (when-let (win (get-buffer-window buf)) (+eshell--setup-window win nil) (cond ((and (one-window-p t) (window-configuration-p (frame-parameter nil 'saved-wconf))) diff --git a/modules/tools/eval/config.el b/modules/tools/eval/config.el index 4f91ce013..e74004554 100644 --- a/modules/tools/eval/config.el +++ b/modules/tools/eval/config.el @@ -15,7 +15,7 @@ (defun +eval*quickrun-auto-close (&rest _) "Allows us to silently re-run quickrun from within the quickrun buffer." - (when-let* ((win (get-buffer-window quickrun--buffer-name))) + (when-let (win (get-buffer-window quickrun--buffer-name)) (let ((inhibit-message t)) (quickrun--kill-running-process) (message "")) @@ -41,7 +41,7 @@ (defun +eval|quickrun-shrink-window () "Shrink the quickrun output window once code evaluation is complete." - (when-let* ((win (get-buffer-window quickrun--buffer-name))) + (when-let (win (get-buffer-window quickrun--buffer-name)) (with-selected-window (get-buffer-window quickrun--buffer-name) (let ((ignore-window-parameters t)) (shrink-window-if-larger-than-buffer))))) @@ -49,7 +49,7 @@ (defun +eval|quickrun-scroll-to-bof () "Ensures window is scrolled to BOF on invocation." - (when-let* ((win (get-buffer-window quickrun--buffer-name))) + (when-let (win (get-buffer-window quickrun--buffer-name)) (with-selected-window win (goto-char (point-min))))) (add-hook 'quickrun-after-run-hook #'+eval|quickrun-scroll-to-bof)) diff --git a/modules/tools/flyspell/autoload.el b/modules/tools/flyspell/autoload.el index 4e6b162cf..54da4e769 100644 --- a/modules/tools/flyspell/autoload.el +++ b/modules/tools/flyspell/autoload.el @@ -16,7 +16,7 @@ ;;;###autoload (defun +flyspell|init-predicate () "TODO" - (when-let* ((pred (assq major-mode +flyspell--predicate-alist))) + (when-let (pred (assq major-mode +flyspell--predicate-alist)) (setq-local flyspell-generic-check-word-predicate (cdr pred)))) ;;;###autoload diff --git a/modules/tools/lookup/autoload/docsets.el b/modules/tools/lookup/autoload/docsets.el index c1b513448..b2433857c 100644 --- a/modules/tools/lookup/autoload/docsets.el +++ b/modules/tools/lookup/autoload/docsets.el @@ -65,7 +65,7 @@ Docsets must be installed with one of the following commands: + `dash-docs-async-install-docset-from-file' Docsets can be searched directly via `+lookup/in-docsets'." - (when-let* ((docsets (cl-remove-if-not #'dash-docs-docset-path (dash-docs-buffer-local-docsets)))) + (when-let (docsets (cl-remove-if-not #'dash-docs-docset-path (dash-docs-buffer-local-docsets))) (+lookup/in-docsets nil identifier docsets) 'deferred)) diff --git a/modules/tools/lookup/autoload/online.el b/modules/tools/lookup/autoload/online.el index c8e67c98c..79908ec19 100644 --- a/modules/tools/lookup/autoload/online.el +++ b/modules/tools/lookup/autoload/online.el @@ -6,11 +6,11 @@ (let ((key (or namespace major-mode))) (or (and (not force-p) (cdr (assq key +lookup--last-provider))) - (when-let* ((provider - (completing-read - "Search on: " - (mapcar #'car +lookup-provider-url-alist) - nil t))) + (when-let (provider + (completing-read + "Search on: " + (mapcar #'car +lookup-provider-url-alist) + nil t)) (setf (alist-get key +lookup--last-provider) provider) provider)))) diff --git a/modules/tools/magit/config.el b/modules/tools/magit/config.el index 96df02b18..abeaf6659 100644 --- a/modules/tools/magit/config.el +++ b/modules/tools/magit/config.el @@ -98,7 +98,7 @@ It is passed a user and repository name.") [tab] #'magit-section-toggle) (after! git-rebase (dolist (key '(("M-k" . "gk") ("M-j" . "gj"))) - (when-let* ((desc (assoc (car key) evil-magit-rebase-commands-w-descriptions))) + (when-let (desc (assoc (car key) evil-magit-rebase-commands-w-descriptions)) (setcar desc (cdr key)))) (evil-define-key* evil-magit-state git-rebase-mode-map "gj" #'git-rebase-move-line-down diff --git a/modules/tools/prodigy/autoload.el b/modules/tools/prodigy/autoload.el index 0c013df59..e0517419f 100644 --- a/modules/tools/prodigy/autoload.el +++ b/modules/tools/prodigy/autoload.el @@ -12,7 +12,7 @@ "Delete service at point. Asks for confirmation." (interactive "P") (prodigy-with-refresh - (when-let* ((service (prodigy-service-at-pos))) + (when-let (service (prodigy-service-at-pos)) (let ((name (plist-get service :name))) (cond ((or arg (y-or-n-p (format "Delete '%s' service?" name))) diff --git a/modules/ui/doom-dashboard/config.el b/modules/ui/doom-dashboard/config.el index a03fe95f4..0e599f044 100644 --- a/modules/ui/doom-dashboard/config.el +++ b/modules/ui/doom-dashboard/config.el @@ -255,7 +255,7 @@ This and `+doom-dashboard|record-project' provides `persp-mode' integration with the Doom dashboard. It ensures that the dashboard is always in the correct project (which may be different across perspective)." (when (bound-and-true-p persp-mode) - (when-let* ((pwd (persp-parameter 'last-project-root))) + (when-let (pwd (persp-parameter 'last-project-root)) (+doom-dashboard-update-pwd pwd)))) (defun +doom-dashboard|record-project (&optional persp &rest _) @@ -420,7 +420,7 @@ controlled by `+doom-dashboard-pwd-policy'." (propertize (symbol-name action) 'face 'font-lock-constant-face))) (format "%-37s" (buffer-string))) ;; Lookup command keys dynamically - (or (when-let* ((key (where-is-internal action nil t))) + (or (when-let (key (where-is-internal action nil t)) (with-temp-buffer (save-excursion (insert (key-description key))) (while (re-search-forward "<\\([^>]+\\)>" nil t) diff --git a/modules/ui/doom/config.el b/modules/ui/doom/config.el index 7b5c9c980..7a4573c2c 100644 --- a/modules/ui/doom/config.el +++ b/modules/ui/doom/config.el @@ -45,12 +45,12 @@ :defer t :init (defun +doom|solaire-mode-swap-bg-maybe () - (when-let* ((rule (assq doom-theme +doom-solaire-themes))) + (when-let (rule (assq doom-theme +doom-solaire-themes)) (require 'solaire-mode) (when (cdr rule) (solaire-mode-swap-bg) (with-eval-after-load 'ansi-color - (when-let* ((color (face-background 'default))) + (when-let (color (face-background 'default)) (setf (aref ansi-color-names-vector 0) color)))))) (add-hook 'doom-load-theme-hook #'+doom|solaire-mode-swap-bg-maybe t) :config diff --git a/modules/ui/neotree/autoload.el b/modules/ui/neotree/autoload.el index cf53d5ac5..783c57f20 100644 --- a/modules/ui/neotree/autoload.el +++ b/modules/ui/neotree/autoload.el @@ -38,7 +38,7 @@ (defun +neotree/collapse-or-up () "Collapse an expanded directory node or go to the parent node." (interactive) - (when-let* ((node (neo-buffer--get-filename-current-line))) + (when-let (node (neo-buffer--get-filename-current-line)) (if (file-directory-p node) (if (neo-buffer--expanded-node-p node) (+neotree/collapse) @@ -49,7 +49,7 @@ (defun +neotree/collapse () "Collapse a neotree node." (interactive) - (when-let* ((node (neo-buffer--get-filename-current-line))) + (when-let (node (neo-buffer--get-filename-current-line)) (when (file-directory-p node) (neo-buffer--set-expand node nil) (neo-buffer--refresh t)) @@ -60,7 +60,7 @@ (defun +neotree/expand-or-open () "Expand or open a neotree node." (interactive) - (when-let* ((node (neo-buffer--get-filename-current-line))) + (when-let (node (neo-buffer--get-filename-current-line)) (cond ((file-directory-p node) (neo-buffer--set-expand node t) (neo-buffer--refresh t) diff --git a/modules/ui/popup/+hacks.el b/modules/ui/popup/+hacks.el index 9ed94e372..9e8ebdebf 100644 --- a/modules/ui/popup/+hacks.el +++ b/modules/ui/popup/+hacks.el @@ -160,8 +160,8 @@ the command buffer." origin) (save-popups! (find-file path) - (-when-let (pos (get-text-property button 'position - (marker-buffer button))) + (when-let (pos (get-text-property button 'position + (marker-buffer button))) (goto-char pos)) (setq origin (selected-window)) (recenter)) @@ -179,7 +179,7 @@ the command buffer." (cl-letf* ((old-org-completing-read (symbol-function 'org-completing-read)) ((symbol-function 'org-completing-read) (lambda (&rest args) - (when-let* ((win (get-buffer-window "*Org Links*"))) + (when-let (win (get-buffer-window "*Org Links*")) ;; While helm is opened as a popup, it will mistaken the ;; *Org Links* popup for the "originated window", and will ;; target it for actions invoked by the user. However, since @@ -216,7 +216,7 @@ the command buffer." ;;;###package Info (defun +popup*switch-to-info-window (&rest _) - (when-let* ((win (get-buffer-window "*info*"))) + (when-let (win (get-buffer-window "*info*")) (when (+popup-window-p win) (select-window win)))) (advice-add #'info-lookup-symbol :after #'+popup*switch-to-info-window) diff --git a/modules/ui/popup/autoload/popup.el b/modules/ui/popup/autoload/popup.el index 17caa9453..ef8e73fb3 100644 --- a/modules/ui/popup/autoload/popup.el +++ b/modules/ui/popup/autoload/popup.el @@ -25,7 +25,7 @@ the buffer is visible, then set another timer and try again later." ((with-demoted-errors "Error killing transient buffer: %s" (with-current-buffer buffer (let (confirm-kill-processes) - (when-let* ((process (get-buffer-process buffer))) + (when-let (process (get-buffer-process buffer)) (kill-process process)) (let (kill-buffer-hook kill-buffer-query-functions) (kill-buffer buffer)))))))))) @@ -50,7 +50,7 @@ the buffer is visible, then set another timer and try again later." (funcall autosave buffer)))) (with-current-buffer buffer (save-buffer))) (let ((ignore-window-parameters t)) - (if-let* ((wconf (window-parameter window 'saved-wconf))) + (if-let (wconf (window-parameter window 'saved-wconf)) (set-window-configuration wconf) (delete-window window))) (unless (window-live-p window) @@ -75,7 +75,7 @@ the buffer is visible, then set another timer and try again later." (defun +popup--delete-other-windows (window) "Fixes `delete-other-windows' when used from a popup window." - (when-let* ((window (ignore-errors (+popup/raise window)))) + (when-let (window (ignore-errors (+popup/raise window))) (let ((ignore-window-parameters t)) (delete-other-windows window))) nil) @@ -179,9 +179,9 @@ and enables `+popup-buffer-mode'." (unless +popup--inhibit-select (select-window window)) window)) - (when-let* ((popup (cl-loop for func in actions - if (funcall func buffer alist) - return it))) + (when-let (popup (cl-loop for func in actions + if (funcall func buffer alist) + return it)) (+popup--init popup alist) (unless +popup--inhibit-select (let ((select (+popup-parameter 'select popup))) @@ -302,7 +302,7 @@ Any non-nil value besides the above will be used as the raw value for ;;;###autoload (defun +popup|kill-buffer-hook () "TODO" - (when-let* ((window (get-buffer-window))) + (when-let (window (get-buffer-window)) (when (+popup-window-p window) (let ((+popup--inhibit-transient t)) (+popup--delete-window window))))) @@ -504,7 +504,7 @@ Accepts the same arguments as `display-buffer-in-side-window'. You must set ((not windows) (cl-letf (((symbol-function 'window--make-major-side-window-next-to) (lambda (_side) (frame-root-window (selected-frame))))) - (when-let* ((window (window--make-major-side-window buffer side slot alist))) + (when-let (window (window--make-major-side-window buffer side slot alist)) (set-window-parameter window 'window-vslot vslot) (add-to-list 'window-persistent-parameters '(window-vslot . writable)) window))) diff --git a/modules/ui/pretty-code/autoload.el b/modules/ui/pretty-code/autoload.el index 4ad18fe69..353d43347 100644 --- a/modules/ui/pretty-code/autoload.el +++ b/modules/ui/pretty-code/autoload.el @@ -98,7 +98,7 @@ Pretty symbols can be unset for emacs-lisp-mode with: (:merge (setq merge (pop plist))) (:alist (setq results (append (pop plist) results))) (_ - (when-let* ((char (plist-get +pretty-code-symbols key))) + (when-let (char (plist-get +pretty-code-symbols key)) (push (cons (pop plist) char) results))))) (dolist (mode (doom-enlist modes)) (unless merge diff --git a/modules/ui/workspaces/autoload/workspaces.el b/modules/ui/workspaces/autoload/workspaces.el index 9b79bd159..10dd85bb6 100644 --- a/modules/ui/workspaces/autoload/workspaces.el +++ b/modules/ui/workspaces/autoload/workspaces.el @@ -53,7 +53,7 @@ "Return a workspace named NAME. Unless NOERROR is non-nil, this throws an error if NAME doesn't exist." (cl-check-type name string) - (when-let* ((persp (persp-get-by-name name))) + (when-let (persp (persp-get-by-name name)) (cond ((+workspace-p persp) persp) ((not noerror) (error "No workspace called '%s' was found" name)))))