From 9677897ef705177ee0497d1f9f6334700abd262d Mon Sep 17 00:00:00 2001
From: Óscar Nájera <hi@oscarnajera.com>
Date: Sat, 7 May 2022 19:16:02 +0200
Subject: Fetch email directly from Emacs

---
 config/doom/config.org | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

(limited to 'config')

diff --git a/config/doom/config.org b/config/doom/config.org
index c2579df..aaff478 100644
--- a/config/doom/config.org
+++ b/config/doom/config.org
@@ -332,6 +332,22 @@ this new window.
 (use-package! org-mime
   :after (org notmuch)
   :config (setq org-mime-library 'mml))
+
+(require 'comint)
+(require 'ansi-color)
+
+(defun on/fetch-all-email ()
+  "Start tagmail fetch on a subprocess."
+  (interactive)
+  (with-current-buffer (get-buffer-create "*E-mail fetch*")
+    (pop-to-buffer (current-buffer))
+    (comint-mode)
+    (ansi-color-for-comint-mode-on)
+    (make-process
+     :name "E-mail fetch"
+     :buffer (current-buffer)
+     :command '("tagmail")
+     :filter #'comint-output-filter)))
 #+END_SRC
 ** Sending email
 #+begin_src emacs-lisp
-- 
cgit v1.2.3