summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorJakob L. Kreuze2020-08-30 17:25:35 -0400
committerJakob L. Kreuze2020-08-30 17:25:35 -0400
commit77098b3f058c48154daf2299004bef0f99356afd (patch)
tree22a54fcf549f95df132e1b36218760908820a0ab /lisp
parent8e231c0dda4d393cc18561b2ceeff250965049b8 (diff)
[news] Implement 'sync-mail'.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/news.el18
1 files changed, 18 insertions, 0 deletions
diff --git a/lisp/news.el b/lisp/news.el
index df1cbf1..ac52708 100644
--- a/lisp/news.el
+++ b/lisp/news.el
@@ -42,3 +42,21 @@
;; Encrypt emails such that we can read them as well.
(setq mml-secure-openpgp-encrypt-to-self t)
+
+;;; Interactive functions for calling mbsync(1).
+
+(defvar mbsync-mailboxes '("Main:INBOX" "Main-Gmail:INBOX"
+ "Old:INBOX""University:INBOX")
+ "List of mailboxes to sync with `sync-mail'.")
+
+(defun sync-mail ()
+ "Asynchronously run mbsync(1) on `mbsync-mailboxes'."
+ (interactive)
+ (let ((process (apply #'start-process "mbsync" nil "mbsync"
+ mbsync-mailboxes)))
+ (message "Syncing mailboxes...")
+ (set-process-sentinel process
+ #'(lambda (process event)
+ (ignore process)
+ (when (string= event "finished\n")
+ (message "Mailboxes synced."))))))

© 2015 - 2026 Jakob L. Kreuze