diff --git a/emacs/mu4e-utils.el b/emacs/mu4e-utils.el index 8b7db29e..fdc8b79b 100644 --- a/emacs/mu4e-utils.el +++ b/emacs/mu4e-utils.el @@ -319,15 +319,19 @@ processing takes part in the background, unless buf is non-nil." (message "Retrieving mail...") (set-process-sentinel proc (lambda (proc msg) - (let ((status (process-status proc)) (code (process-exit-status proc))) + (let* ((status (process-status proc)) + (code (process-exit-status proc)) + ;; sadly, fetchmail returns '1' when there is no mail; this is not really + ;; an error of course, but it's hard to distinguish from a genuine error + (maybe-error (or (not (eq status 'exit)) (/= code 0)))) (message nil) - (if (or (not (eq status 'exit)) (/= code 0)) - (message "Some error occured while retrieving mail") - (progn ;; update went well, now rerun the index - (mu4e-proc-index mu4e-maildir) - (let ((buf (process-buffer proc))) - (when (buffer-live-p buf) - (kill-buffer buf)))))))))) + ;; there may be an error, give the user up to 5 seconds to check + (when maybe-error + (sit-for 5)) + (mu4e-proc-index mu4e-maildir) + (let ((buf (process-buffer proc))) + (when (buffer-live-p buf) + (kill-buffer buf)))))))) (defun mu4e-display-manual () diff --git a/emacs/mu4e-vars.el b/emacs/mu4e-vars.el index ce8588a3..e6ef0fcb 100644 --- a/emacs/mu4e-vars.el +++ b/emacs/mu4e-vars.el @@ -53,7 +53,8 @@ PATH, you can specify the full path." (defcustom mu4e-get-mail-command nil "Shell command to run to retrieve new mail; e.g. 'offlineimap' or -'fetchmail'." +'fetchmail'. Note, when there is no mail, fetchmail will return 1 +as it error code, which mu4e interprets as an error." :type 'string :group 'mu4e :safe 'stringp) @@ -358,6 +359,11 @@ flag set)." "Face for a header title in the headers view." :group 'mu4e-faces) +(defface mu4e-footer-face + '((t :inherit font-lock-comment-face)) + "Face for message footers (signatures)." + :group 'mu4e-faces) + (defface mu4e-view-url-number-face '((t :inherit font-lock-reference-face :bold t)) "Face for the number tags for URLs." @@ -388,11 +394,6 @@ flag set)." "Face for cited message parts (level 4)." :group 'mu4e-faces) -(defface mu4e-view-footer-face - '((t :inherit font-lock-comment-face)) - "Face for message footers (signatures)." - :group 'mu4e-faces) - (defface mu4e-hdrs-marks-face '((t :inherit font-lock-preprocessor-face)) "Face for the mark in the headers list."