Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions mu4e/mu4e-main.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
16 changes: 12 additions & 4 deletions mu4e/mu4e-update.el
Original file line number Diff line number Diff line change
Expand Up @@ -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.")


Expand All @@ -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
Expand All @@ -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))))
Expand Down Expand Up @@ -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))
Expand Down
2 changes: 2 additions & 0 deletions mu4e/mu4e-vars.el
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions mu4e/mu4e.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down