Fix kill ring clobbering by get mail filter

The kill ring fills up with lines like:

  C: 0/1  B: 28/29  M: +0/0 *0/0 #0/0  S: +2/2 *1/1 #0/0

when using mbsync or another tool using carriage return for progress.
This commit is contained in:
Remco van 't Veer 2016-07-27 12:16:21 +02:00 committed by djcb
parent 80ecf80a12
commit 9e6bfb9075
1 changed files with 7 additions and 3 deletions

View File

@ -930,9 +930,13 @@ Also scrolls to the final line, and update the progress throbber."
(with-current-buffer (process-buffer proc)
(goto-char (point-max))
(if (string-match ".*\r\\(.*\\)" msg)
(progn
(kill-line 0)
(insert (match-string 1 msg)))
(progn
;; kill even with \r
(end-of-line)
(let ((end (point)))
(beginning-of-line)
(delete-region (point) end))
(insert (match-string 1 msg)))
(insert msg)))
;; Auto-scroll unless user is interacting with the window.
(when (and (window-live-p procwin)