From: Lars Ingebrigtsen Date: Sat, 1 Oct 2022 14:06:27 +0000 (+0200) Subject: Make "git pull" output slightly prettier X-Git-Tag: emacs-29.0.90~1856^2~102 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e50a3b57921e8b690d3c3adb993e2441d5970116;p=emacs.git Make "git pull" output slightly prettier * lisp/vc/vc-git.el (vc-git--pushpull): Translate ^M in output (bug#58199). --- diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index f5ac43f5361..87f6a5a37c8 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1110,6 +1110,14 @@ If PROMPT is non-nil, prompt for the Git command to run." vc-filter-command-function)) (proc (apply #'vc-do-async-command buffer root git-program command extra-args))) + ;; "git pull" includes progress output that uses ^M to move point + ;; to the beginning of the line. Just translate these to newlines + ;; (but don't do anything with the CRLF sequence). + (add-function :around (process-filter proc) + (lambda (filter process string) + (funcall filter process + (replace-regexp-in-string "\r\\(\\'\\|[^\n]\\)" + "\n\\1" string)))) (with-current-buffer buffer (vc-run-delayed (vc-compilation-mode 'git)