aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/doom/config.org21
1 files changed, 9 insertions, 12 deletions
diff --git a/config/doom/config.org b/config/doom/config.org
index cf4e74e..7c07d7d 100644
--- a/config/doom/config.org
+++ b/config/doom/config.org
@@ -372,18 +372,15 @@ this new window.
(defun on/registered-mail-accounts ()
"Read mbsync config to extract IMAPAccounts."
- (let ((buffer (find-file-noselect
- (expand-file-name
- "~/dev/dotfiles/mail/dot-mbsyncrc.personal"))))
- (with-current-buffer buffer
- (goto-char (point-min))
- (let ((pick (prog1 (->>
- (cl-loop while (search-forward-regexp (rx bol "IMAPAccount " (group (+ any)) eol) nil t)
- collect (match-string 1))
- (cons "all")
- (completing-read "Which mailbox")))))
- (kill-buffer buffer)
- (if (string= pick "all") nil (list pick))))))
+ (with-temp-buffer
+ (insert-file-contents (expand-file-name
+ "~/dev/dotfiles/mail/dot-mbsyncrc.personal"))
+ (let ((pick (thread-last
+ (cl-loop while (search-forward-regexp (rx bol "IMAPAccount " (group (+ any)) eol) nil t)
+ collect (match-string 1))
+ (cons "all")
+ (completing-read "Which mailbox"))))
+ (if (string= pick "all") nil (list pick)))))
(define-derived-mode mail-sync-log-mode comint-mode "mail-sync-log"
"Major mode for reading mail sync."