diff options
Diffstat (limited to 'emacs/.emacs.d/lisp/my/my-gnus.el')
| -rw-r--r-- | emacs/.emacs.d/lisp/my/my-gnus.el | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/emacs/.emacs.d/lisp/my/my-gnus.el b/emacs/.emacs.d/lisp/my/my-gnus.el index 6a2142b..7623548 100644 --- a/emacs/.emacs.d/lisp/my/my-gnus.el +++ b/emacs/.emacs.d/lisp/my/my-gnus.el @@ -419,5 +419,28 @@ The archiving target comes from `my-gnus-group-alist'." (let ((inhibit-message nil)) (message "Copied region with %d links." (length pairs))))) +(defun my-isync-sync-mail () + "Call `mbsync' to sync mail" + (interactive) + (message "isync in progress...") + (set-process-sentinel + (start-process "isync" "*isync*" "mbsync" "-a") + (lambda (proc event) + (let ((status (process-exit-status proc))) + (message "isync in progress...%s: %s" + (if (eq status 0) "done" "failed") + (with-current-buffer (process-buffer proc) + (goto-char (point-max)) + (re-search-backward "
") + (buffer-substring (1+ (point)) (point-max)))) + (gnus-group-get-new-news))))) + +(defun my-gnus-group-refresh (arg) + "Call `gnus-group-get-new-news' or, with a prefix arg, `my-isync-sync-mail'" + (interactive "P") + (if arg + (my-isync-sync-mail) + (gnus-group-get-new-news))) + (provide 'my-gnus) ;;; my-gnus.el ends here |
