From 77098b3f058c48154daf2299004bef0f99356afd Mon Sep 17 00:00:00 2001 From: Jakob L. Kreuze Date: Sun, 30 Aug 2020 17:25:35 -0400 Subject: [news] Implement 'sync-mail'. --- lisp/news.el | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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.")))))) -- cgit v1.3