From 0a715cc3f233497417dc7baae67ee97f5300d246 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 7 Dec 2024 14:35:54 -0500 Subject: [PATCH] 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 --- lisp/cli/gc.el | 8 +- lisp/doom-cli.el | 26 +-- lisp/doom-lib.el | 14 +- lisp/doom.el | 12 +- lisp/lib/buffers.el | 2 +- lisp/lib/files.el | 4 +- lisp/lib/help.el | 6 +- lisp/lib/packages.el | 156 +++++++++--------- lisp/lib/profiles.el | 4 +- lisp/lib/projects.el | 4 +- modules/app/calendar/autoload.el | 6 +- modules/completion/ivy/autoload/ivy.el | 4 +- .../completion/vertico/autoload/workspaces.el | 2 +- modules/config/default/autoload/search.el | 4 +- modules/config/default/autoload/text.el | 4 +- modules/config/literate/autoload.el | 2 +- modules/editor/evil/autoload/textobjects.el | 2 +- modules/emacs/dired/config.el | 2 +- modules/emacs/ibuffer/autoload/workspaces.el | 8 +- modules/email/mu4e/autoload/email.el | 2 +- modules/email/mu4e/config.el | 18 +- modules/email/notmuch/autoload.el | 8 +- modules/lang/clojure/autoload.el | 2 +- modules/lang/emacs-lisp/autoload.el | 2 +- modules/lang/graphql/autoload.el | 4 +- modules/lang/haskell/autoload.el | 6 +- modules/lang/lua/autoload/lua.el | 2 +- modules/lang/org/autoload/org-attach.el | 2 +- modules/lang/org/autoload/org-link.el | 2 +- modules/lang/org/cli.el | 2 +- modules/lang/org/config.el | 4 +- modules/os/tty/config.el | 8 +- modules/term/eshell/autoload/eshell.el | 2 +- modules/term/shell/autoload.el | 2 +- modules/term/vterm/autoload.el | 2 +- modules/tools/debugger/config.el | 2 +- modules/tools/eval/autoload/eval.el | 18 +- modules/tools/lsp/autoload/lsp-mode.el | 2 +- modules/tools/magit/autoload.el | 16 +- modules/ui/ligatures/autoload/ligatures.el | 2 +- modules/ui/ligatures/config.el | 2 +- modules/ui/modeline/+light.el | 2 +- modules/ui/popup/autoload/popup.el | 30 ++-- 43 files changed, 207 insertions(+), 205 deletions(-) diff --git a/lisp/cli/gc.el b/lisp/cli/gc.el index eb1542818..d4211da9f 100644 --- a/lisp/cli/gc.el +++ b/lisp/cli/gc.el @@ -69,10 +69,10 @@ (delq nil (mapcar #'doom-gc--repo repos)))))) (defun doom-gc--eln () - (if-let (dirs - (cl-delete (expand-file-name comp-native-version-dir doom-packages--eln-output-path) - (directory-files doom-packages--eln-output-path t "^[^.]" t) - :test #'file-equal-p)) + (if-let* ((dirs + (cl-delete (expand-file-name comp-native-version-dir doom-packages--eln-output-path) + (directory-files doom-packages--eln-output-path t "^[^.]" t) + :test #'file-equal-p))) (progn (print! (start "Purging old native bytecode...")) (print-group! diff --git a/lisp/doom-cli.el b/lisp/doom-cli.el index 05108803d..f06a4787d 100644 --- a/lisp/doom-cli.el +++ b/lisp/doom-cli.el @@ -272,7 +272,7 @@ execution. Can be generated from a `doom-cli-context' with (defun doom-cli-key (cli) "Return CLI's (type . command), used as a table key or unique identifier." (let ((command (doom-cli-command cli))) - (if-let (type (doom-cli-type cli)) + (if-let* ((type (doom-cli-type cli))) (cons type command) command))) @@ -648,11 +648,11 @@ Throws `doom-cli-invalid-option-error' for illegal values." "A CLI context, containing all state pertinent to the current session." (init-time before-init-time) ; When this context was created ;; A session-specific ID of the current context (defaults to number - (pid (if-let (pid (getenv "__DOOMPID")) + (pid (if-let* ((pid (getenv "__DOOMPID"))) (string-to-number pid) (emacs-pid))) ;; Number of Emacs processes this context has been processed through - (step (if-let (step (getenv "__DOOMSTEP")) + (step (if-let* ((step (getenv "__DOOMSTEP"))) (string-to-number step) -1)) ;; The geometry of the terminal window. @@ -877,10 +877,10 @@ state tied to switches (\"--foo\" or \"-x\") or arbitrary symbols (state). If KEY is a string, fetch KEY from context's OPTIONS (by switch). If KEY is a symbol, fetch KEY from context's STATE. Return NULL-VALUE if KEY does not exist." - (if-let (value - (if (stringp key) - (assoc key (doom-cli-context-options context)) - (assq key (doom-cli-context-state context)))) + (if-let* ((value + (if (stringp key) + (assoc key (doom-cli-context-options context)) + (assq key (doom-cli-context-state context))))) (cdr value) null-value)) @@ -1254,7 +1254,7 @@ Emacs' batch library lacks an implementation of the exec system call." ;; Run a custom action, defined in `doom-cli-exit-commands'. ((pred (keywordp)) - (if-let (fn (alist-get command doom-cli-exit-commands)) + (if-let* ((fn (alist-get command doom-cli-exit-commands))) (funcall fn args context) (error "Invalid exit command: %s" command))) @@ -1290,7 +1290,7 @@ Arguments don't have to be switches either." (when omit (while argv (let ((arg (pop argv))) - (if-let (n (cdr (assoc arg omit))) + (if-let* ((n (cdr (assoc arg omit)))) (if (= n -1) (setq argv nil) (dotimes (i n) (pop argv))) @@ -1905,7 +1905,7 @@ errors to `doom-cli-error-file')." (setq doom-print-backend nil)) (when (doom-cli-context-pipe-p context :in) (with-current-buffer (doom-cli-context-stdin context) - (while (if-let (in (ignore-errors (read-from-minibuffer ""))) + (while (if-let* ((in (ignore-errors (read-from-minibuffer "")))) (insert in "\n") (ignore-errors (delete-char -1)))))) (doom-cli--exit @@ -1960,9 +1960,9 @@ errors to `doom-cli-error-file')." (doom-cli-invalid-prefix-error (let ((prefix (cadr e))) (print! (red "Error: `run!' called with invalid prefix %S") prefix) - (if-let (suggested (cl-loop for cli being the hash-value of doom-cli--table - unless (doom-cli-type cli) - return (car (doom-cli-command cli)))) + (if-let* ((suggested (cl-loop for cli being the hash-value of doom-cli--table + unless (doom-cli-type cli) + return (car (doom-cli-command cli))))) (print! "Did you mean %S?" suggested) (print! "There are no commands defined under %S." prefix))) 4) diff --git a/lisp/doom-lib.el b/lisp/doom-lib.el index 5dea2eb29..efa78252f 100644 --- a/lisp/doom-lib.el +++ b/lisp/doom-lib.el @@ -43,9 +43,9 @@ TYPE should be a keyword of any of the known doom-*-error errors (e.g. :font, (defvar doom-log-level (if init-file-debug - (if-let ((level (getenv-internal "DEBUG")) - (level (string-to-number level)) - ((not (zerop level)))) + (if-let* ((level (getenv-internal "DEBUG")) + (level (string-to-number level)) + ((not (zerop level)))) level 2) 0) @@ -1346,7 +1346,7 @@ NAME is a symbol (e.g. \\='python). FILE is a string that will be appended to the resulting path. If said path doesn't exist, this returns nil, otherwise an absolute path." (let (file-name-handler-alist) - (if-let ((path (doom-module-expand-path key file))) + (if-let* ((path (doom-module-expand-path key file))) (if (or (null file) (file-exists-p path)) path) @@ -1463,7 +1463,7 @@ For more about modules and flags, see `doom!'." ',(doom-module-context-flags doom-module-context) (backquote ,flags)) `(let ((file (file!))) - (if-let ((module (doom-module-from-path file))) + (if-let* ((module (doom-module-from-path file))) (doom-module--has-flag-p (doom-module (car module) (cdr module) :flags) (backquote ,flags)) @@ -1670,9 +1670,9 @@ If DEFAULT? is non-nil, an unspecified CAR/CDR will fall bakc to (_default . "Return PROFILE-NAME's PROFILE, otherwise its PROPERTY, otherwise NULL-VALUE." (when (stringp profile-name) (setq profile-name (intern profile-name))) - (if-let (profile (assq profile-name (doom-profiles))) + (if-let* ((profile (assq profile-name (doom-profiles)))) (if property - (if-let (propval (assq property (cdr profile))) + (if-let* ((propval (assq property (cdr profile)))) (cdr propval) null-value) profile) diff --git a/lisp/doom.el b/lisp/doom.el index e4cc0ce47..47cf550c2 100644 --- a/lisp/doom.el +++ b/lisp/doom.el @@ -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. diff --git a/lisp/lib/buffers.el b/lisp/lib/buffers.el index e8f571d20..7dc60bbc9 100644 --- a/lisp/lib/buffers.el +++ b/lisp/lib/buffers.el @@ -380,7 +380,7 @@ current project." (defun doom/kill-project-buffers (project &optional interactive) "Kill buffers for the specified PROJECT." (interactive - (list (if-let (open-projects (doom-open-projects)) + (list (if-let* ((open-projects (doom-open-projects))) (completing-read "Kill buffers for project: " open-projects nil t nil nil diff --git a/lisp/lib/files.el b/lisp/lib/files.el index 7c154a1ba..e544af836 100644 --- a/lisp/lib/files.el +++ b/lisp/lib/files.el @@ -491,7 +491,7 @@ If FORCE-P, overwrite the destination file if it exists, without confirmation." (let ((host (or (file-remote-p file 'host) "localhost"))) (concat "/" (when (file-remote-p file) (concat (file-remote-p file 'method) ":" - (if-let (user (file-remote-p file 'user)) + (if-let* ((user (file-remote-p file 'user))) (concat user "@" host) host) "|")) @@ -561,7 +561,7 @@ which case it will save it without prompting." "Save this file as root." (interactive) (let ((file (doom--sudo-file-path (buffer-file-name (buffer-base-buffer))))) - (if-let (buffer (find-file-noselect file)) + (if-let* ((buffer (find-file-noselect file))) (let ((origin (current-buffer))) (copy-to-buffer buffer (point-min) (point-max)) (unwind-protect diff --git a/lisp/lib/help.el b/lisp/lib/help.el index fd418e659..e23c21a9f 100644 --- a/lisp/lib/help.el +++ b/lisp/lib/help.el @@ -157,7 +157,7 @@ selection of all minor-modes, active or not." (append (apply #'doom--org-headings files plist) extra-candidates)) ivy-sort-functions-alist) - (if-let (result (completing-read prompt alist nil nil initial-input)) + (if-let* ((result (completing-read prompt alist nil nil initial-input))) (cl-destructuring-bind (file &optional location) (cdr (assoc result alist)) (if action @@ -557,7 +557,7 @@ If prefix arg is present, refresh the cache." (`straight (insert "Straight\n") (package--print-help-section "Pinned") - (insert (if-let (pin (plist-get (cdr (assq package doom-packages)) :pin)) + (insert (if-let* ((pin (plist-get (cdr (assq package doom-packages)) :pin))) pin "unpinned") "\n") @@ -642,7 +642,7 @@ If prefix arg is present, refresh the cache." (insert ")\n")))) (package--print-help-section "Configs") - (if-let ((configs (doom--help-package-configs package))) + (if-let* ((configs (doom--help-package-configs package))) (progn (insert "This package is configured in the following locations:") (dolist (location configs) diff --git a/lisp/lib/packages.el b/lisp/lib/packages.el index b278f9114..067830c5d 100644 --- a/lisp/lib/packages.el +++ b/lisp/lib/packages.el @@ -246,7 +246,7 @@ processed." (memq (plist-get recipe :host) '(github gitlab bitbucket))) (plist-put recipe :type 'git) recipe)) - (repo (if-let (local-repo (plist-get recipe :local-repo)) + (repo (if-let* ((local-repo (plist-get recipe :local-repo))) (directory-file-name local-repo) (ignore-errors (straight-vc-local-repo-name recipe))))) repo @@ -452,7 +452,7 @@ also be a list of module keys." ("gnu" (format "https://elpa.gnu.org/packages/%s.html" package)) (archive - (if-let (src (cdr (assoc package package-archives))) + (if-let* ((src (cdr (assoc package package-archives)))) (format "%s" src) (user-error "%s isn't installed through any known source (%s)" package archive))))) @@ -475,7 +475,7 @@ also be a list of module keys." (require 'straight) (doom-plist-merge (plist-get plist :recipe) - (if-let (recipe (straight-recipes-retrieve package)) + (if-let* ((recipe (straight-recipes-retrieve package))) (cdr (if (memq (car recipe) '(quote \`)) (eval recipe t) recipe)) @@ -623,7 +623,7 @@ each package." (ignore-errors (intern (cadr module))) current-prefix-arg))) (mapc (lambda! (key) - (if-let (packages-file (doom-module-locate-path key doom-module-packages-file)) + (if-let* ((packages-file (doom-module-locate-path key doom-module-packages-file))) (with-current-buffer (or (get-file-buffer packages-file) (find-file-noselect packages-file)) @@ -959,75 +959,77 @@ Must be run from a magit diff buffer." (pinned (doom-package-pinned-alist))) (add-hook 'native-comp-async-cu-done-functions #'doom-packages--native-compile-done-h) (straight--make-build-cache-available) - (if-let (built - (doom-packages--with-recipes recipes (package local-repo recipe) - (let ((repo-dir (straight--repos-dir (or local-repo package))) - (build-dir (straight--build-dir package))) - (unless force-p - ;; Ensure packages with outdated files/bytecode are rebuilt - (let* ((build (if (plist-member recipe :build) - (plist-get recipe :build) - t)) - (want-byte-compile - (or (eq build t) - (memq 'compile build))) - (want-native-compile - (or (eq build t) - (memq 'native-compile build)))) - (and (eq (car-safe build) :not) - (setq want-byte-compile (not want-byte-compile) - want-native-compile (not want-native-compile))) - (when (or (not (featurep 'native-compile)) - (not straight--native-comp-available)) - (setq want-native-compile nil)) - (and (or want-byte-compile want-native-compile) - (or (file-newer-than-file-p repo-dir build-dir) - (file-exists-p (straight--modified-dir package)) - (cl-loop with outdated = nil - for file in (doom-files-in build-dir :match "\\.el$" :full t) - if (or (if want-byte-compile (doom-packages--elc-file-outdated-p file)) - (if want-native-compile (doom-packages--eln-file-outdated-p file))) - do (setq outdated t) - (when want-native-compile - (push file doom-packages--eln-output-expected)) - finally return outdated)) - (puthash package t straight--packages-to-rebuild)))) - (unless (file-directory-p repo-dir) - (doom-packages--cli-recipes-update)) - (condition-case-unless-debug e - (let ((straight-vc-git-post-clone-hook - (cons (lambda! (&key commit) - (print-group! - (if-let (pin (cdr (assoc package pinned))) - (print! (item "Pinned to %s") pin) - (when commit - (print! (item "Checked out %s") commit))))) - straight-vc-git-post-clone-hook))) - (straight-use-package (intern package)) - (when (file-in-directory-p repo-dir straight-base-dir) - ;; HACK: Straight can sometimes fail to clone a repo, - ;; leaving behind an empty directory which, in - ;; future invocations, it will assume indicates a - ;; successful clone (causing load errors later). - (let ((try 0)) - (while (not (file-directory-p (doom-path repo-dir ".git"))) - (when (= try 3) - (error "Failed to clone package")) - (print! (warn "Failed to clone %S, trying again (attempt #%d)...") package (1+ try)) - (delete-directory repo-dir t) - (delete-directory build-dir t) - (straight-use-package (intern package)) - (cl-incf try))) - ;; HACK: Line encoding issues can plague repos with - ;; dirty worktree prompts when updating packages or - ;; "Local variables entry is missing the suffix" - ;; errors when installing them (see #2637), so have - ;; git handle conversion by force. - (when doom--system-windows-p - (let ((default-directory repo-dir)) - (straight--process-run "git" "config" "core.autocrlf" "true"))))) - (error - (signal 'doom-package-error (list package e))))))) + (if-let* ((built + (doom-packages--with-recipes recipes (package local-repo recipe) + (let ((repo-dir (straight--repos-dir (or local-repo package))) + (build-dir (straight--build-dir package))) + (unless force-p + ;; Ensure packages w/ outdated files/bytecode are rebuilt + (let* ((build (if (plist-member recipe :build) + (plist-get recipe :build) + t)) + (want-byte-compile + (or (eq build t) + (memq 'compile build))) + (want-native-compile + (or (eq build t) + (memq 'native-compile build)))) + (and (eq (car-safe build) :not) + (setq want-byte-compile (not want-byte-compile) + want-native-compile (not want-native-compile))) + (when (or (not (featurep 'native-compile)) + (not straight--native-comp-available)) + (setq want-native-compile nil)) + (and (or want-byte-compile want-native-compile) + (or (file-newer-than-file-p repo-dir build-dir) + (file-exists-p (straight--modified-dir package)) + (cl-loop with outdated = nil + for file in (doom-files-in build-dir :match "\\.el$" :full t) + if (or (if want-byte-compile (doom-packages--elc-file-outdated-p file)) + (if want-native-compile (doom-packages--eln-file-outdated-p file))) + do (setq outdated t) + (when want-native-compile + (push file doom-packages--eln-output-expected)) + finally return outdated)) + (puthash package t straight--packages-to-rebuild)))) + (unless (file-directory-p repo-dir) + (doom-packages--cli-recipes-update)) + (condition-case-unless-debug e + (let ((straight-vc-git-post-clone-hook + (cons (lambda! (&key commit) + (print-group! + (if-let* ((pin (cdr (assoc package pinned)))) + (print! (item "Pinned to %s") pin) + (when commit + (print! (item "Checked out %s") commit))))) + straight-vc-git-post-clone-hook))) + (straight-use-package (intern package)) + (when (file-in-directory-p repo-dir straight-base-dir) + ;; HACK: Straight can sometimes fail to clone a + ;; repo, leaving behind an empty directory which, + ;; in future invocations, it will assume + ;; indicates a successful clone (causing load + ;; errors later). + (let ((try 0)) + (while (not (file-directory-p (doom-path repo-dir ".git"))) + (when (= try 3) + (error "Failed to clone package")) + (print! (warn "Failed to clone %S, trying again (attempt #%d)...") package (1+ try)) + (delete-directory repo-dir t) + (delete-directory build-dir t) + (straight-use-package (intern package)) + (cl-incf try))) + ;; HACK: Line encoding issues can plague repos with + ;; dirty worktree prompts when updating packages + ;; or "Local variables entry is missing the + ;; suffix" errors when installing them (see + ;; #2637), so have git handle conversion by + ;; force. + (when doom--system-windows-p + (let ((default-directory repo-dir)) + (straight--process-run "git" "config" "core.autocrlf" "true"))))) + (error + (signal 'doom-package-error (list package e)))))))) (progn (when (and (featurep 'native-compile) straight--native-comp-available) @@ -1279,10 +1281,10 @@ Must be run from a magit diff buffer." e))))))) (defun doom-packages--purge-eln () - (if-let (dirs - (cl-delete (expand-file-name comp-native-version-dir doom-packages--eln-output-path) - (directory-files doom-packages--eln-output-path t "^[^.]" t) - :test #'file-equal-p)) + (if-let* ((dirs + (cl-delete (expand-file-name comp-native-version-dir doom-packages--eln-output-path) + (directory-files doom-packages--eln-output-path t "^[^.]" t) + :test #'file-equal-p))) (progn (print! (start "Purging old native bytecode...")) (print-group! diff --git a/lisp/lib/profiles.el b/lisp/lib/profiles.el index 2935dfe7e..2ddf6a577 100644 --- a/lisp/lib/profiles.el +++ b/lisp/lib/profiles.el @@ -10,7 +10,7 @@ Profile directories are in the format {data-profiles-dir}/$NAME/@/$VERSION, for example: '~/.local/share/doom/_/@/0/'") (defvar doom-profile-load-path - (if-let (path (getenv-internal "DOOMPROFILELOADPATH")) + (if-let* ((path (getenv-internal "DOOMPROFILELOADPATH"))) (mapcar #'expand-file-name (split-string-and-unquote path path-separator)) (list (file-name-concat doom-user-dir "profiles.el") (file-name-concat doom-emacs-dir "profiles.el") @@ -114,7 +114,7 @@ run.") `(,val) `(,(abbreviate-file-name path) ,val)))) (cons `(user-emacs-directory :path ,@val) - (if-let (profile-file (file-exists-p! doom-profile-rcfile path)) + (if-let* ((profile-file (file-exists-p! doom-profile-rcfile path))) (car (doom-file-read profile-file :by 'read*)) (when (file-exists-p (doom-path path subdir "lisp/doom.el")) '((doom-user-dir :path ,@val))))))) diff --git a/lisp/lib/projects.el b/lisp/lib/projects.el index 7d023e72e..93c187633 100644 --- a/lisp/lib/projects.el +++ b/lisp/lib/projects.el @@ -119,8 +119,8 @@ Returns nil if not in a project." "Return the name of the current project. Returns '-' if not in a valid project." - (if-let (project-root (or (doom-project-root dir) - (if dir (expand-file-name dir)))) + (if-let* ((project-root (or (doom-project-root dir) + (if dir (expand-file-name dir))))) (funcall projectile-project-name-function project-root) "-")) diff --git a/modules/app/calendar/autoload.el b/modules/app/calendar/autoload.el index 155d04f5b..9d6f5a3ab 100644 --- a/modules/app/calendar/autoload.el +++ b/modules/app/calendar/autoload.el @@ -5,9 +5,9 @@ "Name of the workspace created by `=calendar', dedicated to calfw.") (defun +calendar--init () - (if-let (win (cl-find-if (lambda (b) (string-match-p "^\\*cfw:" (buffer-name b))) - (doom-visible-windows) - :key #'window-buffer)) + (if-let* ((win (cl-find-if (lambda (b) (string-match-p "^\\*cfw:" (buffer-name b))) + (doom-visible-windows) + :key #'window-buffer))) (select-window win) (call-interactively +calendar-open-function))) diff --git a/modules/completion/ivy/autoload/ivy.el b/modules/completion/ivy/autoload/ivy.el index 0dd6f1789..d7a873e44 100644 --- a/modules/completion/ivy/autoload/ivy.el +++ b/modules/completion/ivy/autoload/ivy.el @@ -160,10 +160,10 @@ If ARG (universal argument), open selection in other-window." (user-error "No completion session is active")) (require 'wgrep) (let ((caller (ivy-state-caller ivy-last))) - (if-let (occur-fn (plist-get +ivy-edit-functions caller)) + (if-let* ((occur-fn (plist-get +ivy-edit-functions caller))) (ivy-exit-with-action (lambda (_) (funcall occur-fn))) - (if-let (occur-fn (plist-get ivy--occurs-list caller)) + (if-let* ((occur-fn (plist-get ivy--occurs-list caller))) (let ((buffer (generate-new-buffer (format "*ivy-occur%s \"%s\"*" (if caller (concat " " (prin1-to-string caller)) "") diff --git a/modules/completion/vertico/autoload/workspaces.el b/modules/completion/vertico/autoload/workspaces.el index 01610da8c..86aba4328 100644 --- a/modules/completion/vertico/autoload/workspaces.el +++ b/modules/completion/vertico/autoload/workspaces.el @@ -81,7 +81,7 @@ buffer will be opened in the current workspace instead." (funcall consult--buffer-display (car buffer)) (+workspace-switch origin-workspace) (message "Switched to %S workspace" origin-workspace) - (if-let (window (get-buffer-window (car buffer))) + (if-let* ((window (get-buffer-window (car buffer)))) (select-window window) (funcall consult--buffer-display (car buffer))))))) diff --git a/modules/config/default/autoload/search.el b/modules/config/default/autoload/search.el index 047333ffa..d3853641e 100644 --- a/modules/config/default/autoload/search.el +++ b/modules/config/default/autoload/search.el @@ -77,7 +77,7 @@ If prefix ARG is set, include ignored/hidden files." (current-prefix-arg (unless (eq arg 'other) arg)) (default-directory (if (eq arg 'other) - (if-let (projects (projectile-relevant-known-projects)) + (if-let* ((projects (projectile-relevant-known-projects))) (completing-read "Search project: " projects nil t) (user-error "There are no known projects")) default-directory))) @@ -101,7 +101,7 @@ If prefix ARG is set, prompt for a known project to search from." (list (or (doom-thing-at-point-or-region) "") (let ((projectile-project-root nil)) (if current-prefix-arg - (if-let (projects (projectile-relevant-known-projects)) + (if-let* ((projects (projectile-relevant-known-projects))) (completing-read "Search project: " projects nil t) (user-error "There are no known projects")) (doom-project-root default-directory))))) diff --git a/modules/config/default/autoload/text.el b/modules/config/default/autoload/text.el index 6fa4f04db..2138b7d8b 100644 --- a/modules/config/default/autoload/text.el +++ b/modules/config/default/autoload/text.el @@ -42,8 +42,8 @@ (defun +default/yank-buffer-path (&optional root) "Copy the current buffer's path to the kill ring." (interactive) - (if-let (filename (or (buffer-file-name (buffer-base-buffer)) - (bound-and-true-p list-buffers-directory))) + (if-let* ((filename (or (buffer-file-name (buffer-base-buffer)) + (bound-and-true-p list-buffers-directory)))) (let ((path (abbreviate-file-name (if root (file-relative-name filename root) diff --git a/modules/config/literate/autoload.el b/modules/config/literate/autoload.el index 5b52f467e..e60d4c0bd 100644 --- a/modules/config/literate/autoload.el +++ b/modules/config/literate/autoload.el @@ -50,7 +50,7 @@ (not (re-search-forward "^ *#\\+begin_src e\\(?:macs-\\)?lisp" nil t)))) (print! (warn "No src blocks to tangle in %s. Skipping...") (path target)) nil) - ((if-let (files (org-babel-tangle-file target dest)) + ((if-let* ((files (org-babel-tangle-file target dest))) (always (print! (success "Done tangling %d file(s)!" (length files)))) (print! (error "Failed to tangle any blocks from your config.")) nil)))))))) diff --git a/modules/editor/evil/autoload/textobjects.el b/modules/editor/evil/autoload/textobjects.el index 46cc29307..6d291925f 100644 --- a/modules/editor/evil/autoload/textobjects.el +++ b/modules/editor/evil/autoload/textobjects.el @@ -26,7 +26,7 @@ This excludes the protocol and querystring." (re-search-forward "://" end t)) (save-excursion (goto-char end) - (- (if-let (pos (re-search-backward "[?#]" beg t)) + (- (if-let* ((pos (re-search-backward "[?#]" beg t))) pos end) (if (evil-visual-state-p) diff --git a/modules/emacs/dired/config.el b/modules/emacs/dired/config.el index 11e87aa24..a6176f070 100644 --- a/modules/emacs/dired/config.el +++ b/modules/emacs/dired/config.el @@ -32,7 +32,7 @@ ;; Use GNU ls as `gls' from `coreutils' if available. Add `(setq ;; dired-use-ls-dired nil)' to your config to suppress the Dired warning ;; when not using GNU ls. - (if-let (gls (executable-find "gls")) + (if-let* ((gls (executable-find "gls"))) (setq insert-directory-program gls) ;; BSD ls doesn't support -v or --group-directories-first (setq args (list (car args))))) diff --git a/modules/emacs/ibuffer/autoload/workspaces.el b/modules/emacs/ibuffer/autoload/workspaces.el index cb14ab039..2bf4e5453 100644 --- a/modules/emacs/ibuffer/autoload/workspaces.el +++ b/modules/emacs/ibuffer/autoload/workspaces.el @@ -20,10 +20,10 @@ (let ((buf (ibuffer-current-buffer t))) (unless (buffer-live-p buf) (user-error "Not a valid or live buffer: %s" buf)) - (if-let (workspaces - (cl-loop for wk in (+workspace-list) - if (+workspace-contains-buffer-p buf wk) - collect wk)) + (if-let* ((workspaces + (cl-loop for wk in (+workspace-list) + if (+workspace-contains-buffer-p buf wk) + collect wk))) (+workspace-switch (if (and (not select-first) (cdr workspaces)) (or (completing-read "Select workspace: " (mapcar #'persp-name workspaces)) diff --git a/modules/email/mu4e/autoload/email.el b/modules/email/mu4e/autoload/email.el index 50fc24376..f4df26eeb 100644 --- a/modules/email/mu4e/autoload/email.el +++ b/modules/email/mu4e/autoload/email.el @@ -311,7 +311,7 @@ When otherwise called, open a dired buffer and enable `dired-mu4e-attach-ctrl-c- (progn (message "No files marked, aborting.") (kill-buffer-and-window)) - (if-let ((mail-target-buffer (bound-and-true-p dired-mail-buffer))) + (if-let* ((mail-target-buffer (bound-and-true-p dired-mail-buffer))) (progn (kill-buffer-and-window) (switch-to-buffer mail-target-buffer)) (if (and (+mu4e-current-buffers) diff --git a/modules/email/mu4e/config.el b/modules/email/mu4e/config.el index 4a1810353..767f7c575 100644 --- a/modules/email/mu4e/config.el +++ b/modules/email/mu4e/config.el @@ -115,9 +115,9 @@ is non-nil." (t #'ido-completing-read)) mu4e-attachment-dir (concat - (if-let ((xdg-download-query (and (executable-find "xdg-user-dir") - (doom-call-process "xdg-user-dir" "DOWNLOAD"))) - (xdg-download-dir (and (= 0 (car xdg-download-query)) (cdr xdg-download-query)))) + (if-let* ((xdg-download-query (and (executable-find "xdg-user-dir") + (doom-call-process "xdg-user-dir" "DOWNLOAD"))) + (xdg-download-dir (and (= 0 (car xdg-download-query)) (cdr xdg-download-query)))) xdg-download-dir (expand-file-name (or (getenv "XDG_DOWNLOAD_DIR") "Downloads") @@ -291,12 +291,12 @@ is non-nil." (defun +mu4e-view-select-attachment () "Use completing-read to select a single attachment. Acts like a singular `mu4e-view-save-attachments', without the saving." - (if-let ((parts (delq nil (mapcar - (lambda (part) - (when (assoc "attachment" (cdr part)) - part)) - (mu4e--view-gather-mime-parts)))) - (files (+mu4e-part-selectors parts))) + (if-let* ((parts (delq nil (mapcar + (lambda (part) + (when (assoc "attachment" (cdr part)) + part)) + (mu4e--view-gather-mime-parts)))) + (files (+mu4e-part-selectors parts))) (cdr (assoc (completing-read "Select attachment: " (mapcar #'car files)) files)) (user-error (mu4e-format "No attached files found")))) diff --git a/modules/email/notmuch/autoload.el b/modules/email/notmuch/autoload.el index b7a27834d..548655209 100644 --- a/modules/email/notmuch/autoload.el +++ b/modules/email/notmuch/autoload.el @@ -44,10 +44,10 @@ ((or `mbsync `mbsync-xdg) ; DEPRECATED `mbsync-xdg' is now just `mbsync' (format "mbsync %s -a && notmuch new" - (if-let (config-file - (doom-glob (or (getenv "XDG_CONFIG_HOME") - "~/.config") - "isync/mbsyncrc")) + (if-let* ((config-file + (doom-glob (or (getenv "XDG_CONFIG_HOME") + "~/.config") + "isync/mbsyncrc"))) (format "-c %S" (car config-file)) ""))) (`offlineimap diff --git a/modules/lang/clojure/autoload.el b/modules/lang/clojure/autoload.el index 9bdc17a63..b3bc4beef 100644 --- a/modules/lang/clojure/autoload.el +++ b/modules/lang/clojure/autoload.el @@ -20,7 +20,7 @@ at point." ;; type is `clj' for clojure and `cljs' for clojurescript ;; ... with no type specified, assume `clj'. (let ((type (or type 'clj))) - (if-let (buffer (cider-current-repl type)) + (if-let* ((buffer (cider-current-repl type))) (pop-to-buffer buffer) (let ((process (cond ((eq type 'clj) (cider-jack-in-clj arg)) ((eq type 'cljs) (cider-jack-in-cljs arg))))) diff --git a/modules/lang/emacs-lisp/autoload.el b/modules/lang/emacs-lisp/autoload.el index ffc8c8f7a..98b21875f 100644 --- a/modules/lang/emacs-lisp/autoload.el +++ b/modules/lang/emacs-lisp/autoload.el @@ -91,7 +91,7 @@ Intended to replace `lisp-outline-level'." ;;;###autoload (defun +emacs-lisp-lookup-definition (_thing) "Lookup definition of THING." - (if-let (module (+emacs-lisp--module-at-point)) + (if-let* ((module (+emacs-lisp--module-at-point))) (doom/help-modules (car module) (cadr module) 'visit-dir) (call-interactively #'elisp-def))) diff --git a/modules/lang/graphql/autoload.el b/modules/lang/graphql/autoload.el index 953025e5e..8ed7f125a 100644 --- a/modules/lang/graphql/autoload.el +++ b/modules/lang/graphql/autoload.el @@ -7,8 +7,8 @@ (interactive) (let ((config (json-read-file (graphql-locate-config ".")))) (let-alist config - (if-let ((endpoints .extensions.endpoints) - (endpoint (cdr (assq (intern (graphql--completing-read-endpoint endpoints)) endpoints)))) + (if-let* ((endpoints .extensions.endpoints) + (endpoint (cdr (assq (intern (graphql--completing-read-endpoint endpoints)) endpoints)))) (let-alist endpoint (graphql-doc--start .url `(:url ,.url :headers ,.headers))) (error "No endpoint configurations in .graphqlconfig"))))) diff --git a/modules/lang/haskell/autoload.el b/modules/lang/haskell/autoload.el index a6fc372e0..0ed368c14 100644 --- a/modules/lang/haskell/autoload.el +++ b/modules/lang/haskell/autoload.el @@ -5,9 +5,9 @@ "Opens a Haskell REPL." (interactive "P") (require 'haskell-interactive-mode) - (if-let (window - (display-buffer - (haskell-session-interactive-buffer (haskell-session)))) + (if-let* ((window + (display-buffer + (haskell-session-interactive-buffer (haskell-session))))) (window-buffer window) (error "Failed to display Haskell REPL"))) diff --git a/modules/lang/lua/autoload/lua.el b/modules/lang/lua/autoload/lua.el index c519cbab5..fb10215e8 100644 --- a/modules/lang/lua/autoload/lua.el +++ b/modules/lang/lua/autoload/lua.el @@ -47,6 +47,6 @@ Returns nil if 'love' executable can't be found." (defun +lua/run-love-game () "Run the current project with Love2D." (interactive) - (if-let (cmd (+lua-love-build-command)) + (if-let* ((cmd (+lua-love-build-command))) (async-shell-command cmd) (user-error "Couldn't find love project"))) diff --git a/modules/lang/org/autoload/org-attach.el b/modules/lang/org/autoload/org-attach.el index dbe88739b..f88da2b5c 100644 --- a/modules/lang/org/autoload/org-attach.el +++ b/modules/lang/org/autoload/org-attach.el @@ -19,7 +19,7 @@ "TODO" (interactive) (require 'org-attach) - (if-let (dir (org-attach-dir)) + (if-let* ((dir (org-attach-dir))) (pop-to-buffer ;; Rather than opening dired *and* image-dired windows, suppress them ;; both and open only the image-dired window. diff --git a/modules/lang/org/autoload/org-link.el b/modules/lang/org/autoload/org-link.el index 34ebb2d07..a38047c59 100644 --- a/modules/lang/org/autoload/org-link.el +++ b/modules/lang/org/autoload/org-link.el @@ -341,7 +341,7 @@ exist, and `org-link' otherwise." "Interpret LINK as an URL to an image file." (when (and (image-type-from-file-name link) (not (eq org-display-remote-inline-images 'skip))) - (if-let (buf (url-retrieve-synchronously (concat protocol ":" link))) + (if-let* ((buf (url-retrieve-synchronously (concat protocol ":" link)))) (with-current-buffer buf (goto-char (point-min)) (re-search-forward "\r?\n\r?\n" nil t) diff --git a/modules/lang/org/cli.el b/modules/lang/org/cli.el index 8429eeab6..24164def5 100644 --- a/modules/lang/org/cli.el +++ b/modules/lang/org/cli.el @@ -133,7 +133,7 @@ EXAMPLES: ;; Tangling doesn't expand #+INCLUDE directives, so we do it ;; ourselves, since includes are so useful for literate configs! (org-export-expand-include-keyword) - (if-let ((results (reverse (org-babel-tangle nil nil lang)))) + (if-let* ((results (reverse (org-babel-tangle nil nil lang)))) (dolist (file results) (if (not quiet?) (print-group! diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 3c3d558fd..f8787a699 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -794,7 +794,7 @@ these buffers they'll see a gimped, half-broken org buffer, so to avoid that, install a hook to restart `org-mode' when they're switched to so they can grow up to be fully-fledged org-mode buffers." :around #'org-get-agenda-file-buffer - (if-let (buf (org-find-base-buffer-visiting file)) + (if-let* ((buf (org-find-base-buffer-visiting file))) buf (let ((recentf-exclude '(always)) (doom-inhibit-large-file-detection t) @@ -1124,7 +1124,7 @@ between the two." (defadvice! +org-eldoc--display-link-at-point-a (&rest _) "Display help for doom-*: links in minibuffer when cursor/mouse is over it." :before-until #'org-eldoc-documentation-function - (if-let ((url (thing-at-point 'url t))) + (if-let* ((url (thing-at-point 'url t))) (format "LINK: %s" url) (and (eq (get-text-property (point) 'help-echo) #'+org-link-doom--help-echo-from-textprop) diff --git a/modules/os/tty/config.el b/modules/os/tty/config.el index 36a69a188..4337437ff 100644 --- a/modules/os/tty/config.el +++ b/modules/os/tty/config.el @@ -63,8 +63,8 @@ ;; terminals. Requires the `input-decode-map' entry in ;; lisp/doom-keybinds.el. (define-key! key-translation-map - [?\C-i] (cmd! (if-let (((kkp--terminal-has-active-kkp-p)) - (keys (this-single-command-raw-keys)) - ((> (length keys) 2)) - ((equal (cl-subseq keys -3) [27 91 49]))) + [?\C-i] (cmd! (if-let* (((kkp--terminal-has-active-kkp-p)) + (keys (this-single-command-raw-keys)) + ((> (length keys) 2)) + ((equal (cl-subseq keys -3) [27 91 49]))) [C-i] [?\C-i])))) diff --git a/modules/term/eshell/autoload/eshell.el b/modules/term/eshell/autoload/eshell.el index bc83ee5d4..0df42fbf9 100644 --- a/modules/term/eshell/autoload/eshell.el +++ b/modules/term/eshell/autoload/eshell.el @@ -98,7 +98,7 @@ (with-current-buffer eshell-buffer (fundamental-mode) (erase-buffer)))) - (if-let (win (get-buffer-window eshell-buffer)) + (if-let* ((win (get-buffer-window eshell-buffer))) (let (confirm-kill-processes) (delete-window win) (ignore-errors (kill-buffer eshell-buffer))) diff --git a/modules/term/shell/autoload.el b/modules/term/shell/autoload.el index 6fad60dae..7f758e520 100644 --- a/modules/term/shell/autoload.el +++ b/modules/term/shell/autoload.el @@ -68,7 +68,7 @@ If popup is focused, kill it." (safe-persp-name (get-current-persp)) "main")))) (dir default-directory)) - (if-let (win (get-buffer-window buffer)) + (if-let* ((win (get-buffer-window buffer))) (let (confirm-kill-processes) (set-process-query-on-exit-flag (get-buffer-process buffer) nil) (delete-window win) diff --git a/modules/term/vterm/autoload.el b/modules/term/vterm/autoload.el index e34faeb78..b5bf1ffb7 100644 --- a/modules/term/vterm/autoload.el +++ b/modules/term/vterm/autoload.el @@ -27,7 +27,7 @@ Returns the vterm buffer." (kill-buffer buffer)) (when (window-live-p window) (delete-window window)))) - (if-let (win (get-buffer-window buffer-name)) + (if-let* ((win (get-buffer-window buffer-name))) (delete-window win) (let ((buffer (or (cl-loop for buf in (doom-buffers-in-mode 'vterm-mode) if (equal (buffer-local-value '+vterm--id buf) diff --git a/modules/tools/debugger/config.el b/modules/tools/debugger/config.el index f8ed07f80..f6d13b199 100644 --- a/modules/tools/debugger/config.el +++ b/modules/tools/debugger/config.el @@ -58,7 +58,7 @@ ;; Realgud doesn't generate its autoloads properly so we do it ourselves (dolist (debugger +debugger--realgud-alist) (autoload (car debugger) - (if-let (sym (plist-get (cdr debugger) :package)) + (if-let* ((sym (plist-get (cdr debugger) :package))) (symbol-name sym) "realgud") nil t)) diff --git a/modules/tools/eval/autoload/eval.el b/modules/tools/eval/autoload/eval.el index e4ad97864..6e2a3f8b8 100644 --- a/modules/tools/eval/autoload/eval.el +++ b/modules/tools/eval/autoload/eval.el @@ -92,14 +92,14 @@ of the buffer instead." #'+eval/send-region-to-repl) beg end)) ((let (lang) - (if-let ((runner - (or (alist-get runner-major-mode +eval-runners) - (and (require 'quickrun nil t) - (equal (setq - lang (quickrun--command-key - (buffer-file-name (buffer-base-buffer)))) - "emacs") - (alist-get 'emacs-lisp-mode +eval-runners))))) + (if-let* ((runner + (or (alist-get runner-major-mode +eval-runners) + (and (require 'quickrun nil t) + (equal (setq + lang (quickrun--command-key + (buffer-file-name (buffer-base-buffer)))) + "emacs") + (alist-get 'emacs-lisp-mode +eval-runners))))) (funcall runner beg end) (let ((quickrun-option-cmdkey lang)) (quickrun-region beg end)))))))) @@ -126,7 +126,7 @@ of the buffer instead." (buffer-file-name (buffer-base-buffer)))) "emacs") (alist-get 'emacs-lisp-mode +eval-runners))) - (if-let ((buffer-handler (plist-get (cdr (alist-get major-mode +eval-repls)) :send-buffer))) + (if-let* ((buffer-handler (plist-get (cdr (alist-get major-mode +eval-repls)) :send-buffer))) (funcall buffer-handler) (+eval/region (point-min) (point-max))) (quickrun)))) diff --git a/modules/tools/lsp/autoload/lsp-mode.el b/modules/tools/lsp/autoload/lsp-mode.el index 25615ecd4..aa08be32d 100644 --- a/modules/tools/lsp/autoload/lsp-mode.el +++ b/modules/tools/lsp/autoload/lsp-mode.el @@ -5,7 +5,7 @@ (defun set-lsp-priority! (client priority) "Change the PRIORITY of lsp CLIENT." (require 'lsp-mode) - (if-let (client (gethash client lsp-clients)) + (if-let* ((client (gethash client lsp-clients))) (setf (lsp--client-priority client) priority) (error "No LSP client named %S" client))) diff --git a/modules/tools/magit/autoload.el b/modules/tools/magit/autoload.el index f3135523d..805d8b740 100644 --- a/modules/tools/magit/autoload.el +++ b/modules/tools/magit/autoload.el @@ -53,16 +53,16 @@ window that already exists in that direction. It will split otherwise." (let ((direction (or (alist-get 'direction alist) +magit-open-windows-in-direction)) (origin-window (selected-window))) - (if-let (window (window-in-direction direction)) + (if-let* ((window (window-in-direction direction))) (unless magit-display-buffer-noselect (select-window window)) - (if-let (window (and (not (one-window-p)) - (window-in-direction - (pcase direction - (`right 'left) - (`left 'right) - ((or `up `above) 'down) - ((or `down `below) 'up))))) + (if-let* ((window (and (not (one-window-p)) + (window-in-direction + (pcase direction + (`right 'left) + (`left 'right) + ((or `up `above) 'down) + ((or `down `below) 'up)))))) (unless magit-display-buffer-noselect (select-window window)) (let ((window (split-window nil nil direction))) diff --git a/modules/ui/ligatures/autoload/ligatures.el b/modules/ui/ligatures/autoload/ligatures.el index eb3bb263d..cee9be08d 100644 --- a/modules/ui/ligatures/autoload/ligatures.el +++ b/modules/ui/ligatures/autoload/ligatures.el @@ -43,7 +43,7 @@ Note that this will keep all ligatures in `+ligatures-prog-mode-list' active, as (push (cons (pop plist) char) results)))) (dolist (mode (ensure-list modes)) (setf (alist-get mode +ligatures-extra-alist) - (if-let (old-results (alist-get mode +ligatures-extra-alist)) + (if-let* ((old-results (alist-get mode +ligatures-extra-alist))) (dolist (cell results old-results) (setf (alist-get (car cell) old-results) (cdr cell))) results)))))) diff --git a/modules/ui/ligatures/config.el b/modules/ui/ligatures/config.el index 00169e1fd..d4bc906be 100644 --- a/modules/ui/ligatures/config.el +++ b/modules/ui/ligatures/config.el @@ -111,7 +111,7 @@ isn't disabled in `+ligatures-extras-in-modes'." (when-let* (((+ligatures--enable-p +ligatures-extras-in-modes)) (symbols - (if-let ((symbols (assq major-mode +ligatures-extra-alist))) + (if-let* ((symbols (assq major-mode +ligatures-extra-alist))) (cdr symbols) (cl-loop for (mode . symbols) in +ligatures-extra-alist if (derived-mode-p mode) diff --git a/modules/ui/modeline/+light.el b/modules/ui/modeline/+light.el index 26515b65f..64a40a818 100644 --- a/modules/ui/modeline/+light.el +++ b/modules/ui/modeline/+light.el @@ -129,7 +129,7 @@ Using optionals attributes FACE, HELP-ECHO and VOFFSET." "Set the modeline to NAME. If DEFAULT is non-nil, apply to all future buffers. Modelines are defined with `def-modeline!'." - (if-let (format (assq name +modeline-format-alist)) + (if-let* ((format (assq name +modeline-format-alist))) (cl-destructuring-bind (lhs . rhs) (cdr format) (if default (setq-default +modeline-format-left lhs diff --git a/modules/ui/popup/autoload/popup.el b/modules/ui/popup/autoload/popup.el index 5bd44a299..c4aa72280 100644 --- a/modules/ui/popup/autoload/popup.el +++ b/modules/ui/popup/autoload/popup.el @@ -47,7 +47,7 @@ the buffer is visible, then set another timer and try again later." (let ((buffer (window-buffer window)) (inhibit-quit t)) (and (or (buffer-file-name buffer) - (if-let (base-buffer (buffer-base-buffer buffer)) + (if-let* ((base-buffer (buffer-base-buffer buffer))) (buffer-file-name base-buffer))) (buffer-modified-p buffer) (let ((autosave (+popup-parameter 'autosave window))) @@ -58,7 +58,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) @@ -351,13 +351,13 @@ Any non-nil value besides the above will be used as the raw value for (defun +popup/other () "Cycle through popup windows, like `other-window'. Ignores regular windows." (interactive) - (if-let (popups (cl-remove-if-not - (lambda (w) (or (+popup-window-p w) - ;; This command should be able to hop between - ;; windows with a `no-other-window' - ;; parameter, since `other-window' won't. - (window-parameter w 'no-other-window))) - (window-list))) + (if-let* ((popups (cl-remove-if-not + (lambda (w) (or (+popup-window-p w) + ;; This command should be able to hop between + ;; windows with a `no-other-window' + ;; parameter, since `other-window' won't. + (window-parameter w 'no-other-window))) + (window-list)))) (select-window (if (or (+popup-window-p) (window-parameter nil 'no-other-window)) (let ((window (selected-window))) @@ -450,12 +450,12 @@ window and return that window." (defun +popup/diagnose () "Reveal what popup rule will be used for the current buffer." (interactive) - (if-let (rule (cl-loop with bname = (buffer-name) - for (pred . action) in display-buffer-alist - if (and (functionp pred) (funcall pred bname action)) - return (cons pred action) - else if (and (stringp pred) (string-match-p pred bname)) - return (cons pred action))) + (if-let* ((rule (cl-loop with bname = (buffer-name) + for (pred . action) in display-buffer-alist + if (and (functionp pred) (funcall pred bname action)) + return (cons pred action) + else if (and (stringp pred) (string-match-p pred bname)) + return (cons pred action)))) (message "Rule matches: %s" rule) (message "No popup rule for this buffer")))