Handle mbsync output in mu4e-update buffer

The mbsync command uses carriage return characters to go to the
beginning of the line.
This commit is contained in:
Remco van 't Veer 2016-07-08 14:12:30 +02:00
parent b31ba3dd81
commit b203226a06
1 changed files with 5 additions and 1 deletions

View File

@ -895,7 +895,11 @@ Also scrolls to the final line, and update the progress throbber."
;; Insert at end of buffer. Leave point alone.
(with-current-buffer (process-buffer proc)
(goto-char (point-max))
(insert msg))
(if (string-match ".*\r\\(.*\\)" msg)
(progn
(kill-line 0)
(insert (match-string 1 msg)))
(insert msg)))
;; Auto-scroll unless user is interacting with the window.
(when (and (window-live-p procwin)
(not (eq (selected-window) procwin)))