diff options
| author | Jakob L. Kreuze | 2020-08-30 17:25:35 -0400 |
|---|---|---|
| committer | Jakob L. Kreuze | 2020-08-30 17:25:35 -0400 |
| commit | 77098b3f058c48154daf2299004bef0f99356afd (patch) | |
| tree | 22a54fcf549f95df132e1b36218760908820a0ab | |
| parent | 8e231c0dda4d393cc18561b2ceeff250965049b8 (diff) | |
[news] Implement 'sync-mail'.
| -rw-r--r-- | lisp/news.el | 18 |
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.")))))) |