From 88f5530a9b861ae3f3003171ef9efa98ab1f8222 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mattias=20Engdeg=C3=A5rd?= Date: Tue, 27 Oct 2020 13:20:20 +0100 Subject: [PATCH] ERT: escape control characters in pretty-printed error output * lisp/emacs-lisp/ert.el (ert--pp-with-indentation-and-newline): Escape control characters which would otherwise be blasted directly to the terminal (when running noninteractively) with unpleasant results. --- lisp/emacs-lisp/ert.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index ebb27e8a62c..baa04f2c6af 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -1305,7 +1305,8 @@ EXPECTEDP specifies whether the result was expected." "Pretty-print OBJECT, indenting it to the current column of point. Ensures a final newline is inserted." (let ((begin (point)) - (pp-escape-newlines nil)) + (pp-escape-newlines nil) + (print-escape-control-characters t)) (pp object (current-buffer)) (unless (bolp) (insert "\n")) (save-excursion -- 2.39.5