mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
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:
@ -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)
|
||||
|
@ -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"))))
|
||||
|
||||
|
Reference in New Issue
Block a user