From b203226a0689a5eefcc33dd00be405945740bbba Mon Sep 17 00:00:00 2001 From: Remco van 't Veer Date: Fri, 8 Jul 2016 14:12:30 +0200 Subject: [PATCH] Handle mbsync output in mu4e-update buffer The mbsync command uses carriage return characters to go to the beginning of the line. --- mu4e/mu4e-utils.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mu4e/mu4e-utils.el b/mu4e/mu4e-utils.el index e6acf8ae..311fe1d3 100644 --- a/mu4e/mu4e-utils.el +++ b/mu4e/mu4e-utils.el @@ -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)))