aboutsummaryrefslogtreecommitdiffstats
path: root/config/doom
diff options
context:
space:
mode:
authorOscar Najera <hi@oscarnajera.com>2024-07-21 21:26:49 +0200
committerOscar Najera <hi@oscarnajera.com>2024-07-21 21:26:49 +0200
commit0ceb6b46a657c312d58e886fbfe105110bfbe774 (patch)
tree9b5e5e3bec85af54603510a847c57181b3049e4f /config/doom
parent8c69131ad3e23373f2abe4a8d569acaaa7f32562 (diff)
downloaddotfiles-0ceb6b46a657c312d58e886fbfe105110bfbe774.tar.gz
dotfiles-0ceb6b46a657c312d58e886fbfe105110bfbe774.tar.bz2
dotfiles-0ceb6b46a657c312d58e886fbfe105110bfbe774.zip
fetch mail emacs
Diffstat (limited to 'config/doom')
-rw-r--r--config/doom/config.org22
1 files changed, 12 insertions, 10 deletions
diff --git a/config/doom/config.org b/config/doom/config.org
index 322ae98..5569a8c 100644
--- a/config/doom/config.org
+++ b/config/doom/config.org
@@ -434,12 +434,9 @@ this new window.
"Read mbsync config to extract IMAPAccounts."
(with-temp-buffer
(insert-file-contents (expand-file-name "~/.mbsyncrc"))
- (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)))))
+ (cl-loop while (search-forward-regexp (rx bol "IMAPAccount " (group (+ any)) eol) nil t)
+ collect (match-string 1))))
+
(define-derived-mode mail-sync-log-mode comint-mode "mail-sync-log"
"Major mode for reading mail sync."
@@ -448,16 +445,21 @@ this new window.
(,(rx bol " [mv]") . font-lock-constant-face)
(,(rx bol " [rm]") . font-lock-keyword-face)))))
-(defun on/fetch-all-email ()
- "Start tagmail fetch on a subprocess."
- (interactive)
+(defun on/fetch-all-email (mailbox)
+ "Start tagmail fetch on a subprocess for MAILBOX."
+ (interactive (list (completing-read
+ "Which mailbox?"
+ (on/registered-mail-accounts)
+ nil nil nil nil "all")))
(with-current-buffer (get-buffer-create "*E-mail fetch*")
(pop-to-buffer (current-buffer))
(mail-sync-log-mode)
(make-process
:name "E-mail fetch"
:buffer (current-buffer)
- :command (cons "tagmail" (on/registered-mail-accounts))
+ :command (thread-last
+ (if (string= mailbox "all") nil (list mailbox))
+ (cons "tagmail"))
:filter #'comint-output-filter)))
#+END_SRC
** Sending email