* mu4e.el, mu4e-proc.el: make updating mail asynchronous

- run update process in an inferior process
  - don't use emacs24isms
This commit is contained in:
Dirk-Jan C. Binnema
2012-02-27 21:48:07 +02:00
parent 85be02c195
commit 9021a2ca16
2 changed files with 35 additions and 21 deletions

View File

@ -436,25 +436,6 @@ The result will be delivered to the function registered as
(error "Unsupported compose-type"))
(mu4e-proc-send-command "compose %s %d" (symbol-name compose-type) docid))
(defconst mu4e-update-buffer-name "*update*"
"*internal* Name of the buffer to download mail")
(defun mu4e-proc-retrieve-mail-update-db ()
"Try to retrieve mail (using the user-provided shell command),
and update the database afterwards."
(unless mu4e-get-mail-command
(error "`mu4e-get-mail-command' is not defined"))
(let ((buf (get-buffer-create mu4e-update-buffer-name)))
(split-window-vertically -8)
(switch-to-buffer-other-window buf)
(with-current-buffer buf
(erase-buffer))
(message "Retrieving mail...")
(call-process-shell-command mu4e-get-mail-command nil buf t)
(message "Updating the database...")
(mu4e-proc-index mu4e-maildir)
(with-current-buffer buf
(kill-buffer-and-window))))
(provide 'mu4e-proc)