summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
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