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

@ -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)

View File

@ -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"))))