aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorOscar Najera <hi@oscarnajera.com>2023-08-25 12:18:40 +0200
committerOscar Najera <hi@oscarnajera.com>2023-08-25 12:18:40 +0200
commit9c3eda5edb5b4ea64af48d9a0492413b0271c643 (patch)
tree0c78726e86bd8c9b834a5618415477a0457fa1f9 /config
parent85d0c2059d2255c0bb05c3fd38a45fd182b22d88 (diff)
downloaddotfiles-9c3eda5edb5b4ea64af48d9a0492413b0271c643.tar.gz
dotfiles-9c3eda5edb5b4ea64af48d9a0492413b0271c643.tar.bz2
dotfiles-9c3eda5edb5b4ea64af48d9a0492413b0271c643.zip
pick IMAP account
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."