diff --git a/mu4e/mu4e-main.el b/mu4e/mu4e-main.el index 7e9743749..c167c5915 100644 --- a/mu4e/mu4e-main.el +++ b/mu4e/mu4e-main.el @@ -306,8 +306,12 @@ When REFRESH is non nil refresh infos from server." (lambda()(interactive) (mu4e-context-switch)(revert-buffer))) - (mu4e--main-action-str "\t* [U]pdate email & database\n" - 'mu4e-update-mail-and-index) + (mu4e--main-action-str (concat + "\t* [U]pdate email & database " + (when mu4e~update-status + (format "(%s)" mu4e~update-status)) + "\n") + 'mu4e-update-mail-and-index) ;; show the queue functions if `smtpmail-queue-dir' is defined (if (file-directory-p smtpmail-queue-dir) diff --git a/mu4e/mu4e-update.el b/mu4e/mu4e-update.el index bdebf4378..04a98d8f9 100644 --- a/mu4e/mu4e-update.el +++ b/mu4e/mu4e-update.el @@ -144,7 +144,11 @@ If non-nil, this is a plist of the form: "Height of the mu4e message retrieval/update buffer.") (defvar mu4e--get-mail-ask-password "mu4e get-mail: Enter password: " "Query string for `mu4e-get-mail-command' password.") -(defvar mu4e--get-mail-password-regexp "^Remote: Enter password: $" +(defvar mu4e--get-mail-password-regexp + (rx (: bol + (zero-or-more (in alnum "_: ")) + (or "P" "p") "ass" (or "word" "phrase") ":" + (zero-or-one " ") eol)) "Regexp for a `mu4e-get-mail-command' password query.") @@ -153,7 +157,7 @@ If non-nil, this is a plist of the form: Currently the filter only checks if the command asks for a password by matching the output against -`mu4e~get-mail-password-regexp'. The messages are inserted into +`mu4e--get-mail-password-regexp'. The messages are inserted into the process buffer. Also scrolls to the final line, and update the progress @@ -166,8 +170,10 @@ throbber." (process-send-string proc (concat (read-passwd mu4e--get-mail-ask-password) "\n")) - ;; TODO kill process? - (mu4e-error "Unrecognized password request"))) + (setq mu4e~update-status + (format "authorisation failed @ %s" (format-time-string "%H:%M"))) + (mu4e-error "Unrecognized password request") + (kill-process proc))) (when (process-buffer proc) (let ((inhibit-read-only t) (procwin (get-buffer-window (process-buffer proc)))) @@ -277,6 +283,8 @@ run in the background; otherwise, pop up a window." (make-progress-reporter (mu4e-format "Retrieving mail...")))) (set-process-sentinel proc 'mu4e--update-sentinel-func) + (setq mu4e~update-status + (concat "started update @ " (format-time-string "%H:%M"))) ;; if we're running in the foreground, handle password requests (unless run-in-background (process-put proc 'x-interactive (not run-in-background)) diff --git a/mu4e/mu4e-vars.el b/mu4e/mu4e-vars.el index 8a23ee6d8..877ab2544 100644 --- a/mu4e/mu4e-vars.el +++ b/mu4e/mu4e-vars.el @@ -371,6 +371,8 @@ header-view, not including, for instance, the message body.") ;;; Run-time variables / constants ;;;; Main +(defvar mu4e~update-status nil + "The current update status of the mail collection.") ;;;; Other diff --git a/mu4e/mu4e.el b/mu4e/mu4e.el index 61217aae8..502af2068 100644 --- a/mu4e/mu4e.el +++ b/mu4e/mu4e.el @@ -216,6 +216,8 @@ invoke (if mu4e-index-lazy-check "Lazy indexing" "Indexing") checked updated cleaned-up) (run-hooks 'mu4e-index-updated-hook) + (setq mu4e~update-status (format "index complete @ %s" + (format-time-string "%H:%M"))) ;; backward compatibility... (unless (zerop (+ updated cleaned-up)) mu4e-message-changed-hook)