summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorF. Jason Park <jp@neverwas.me>2024-08-09 16:49:28 -0700
committerF. Jason Park <jp@neverwas.me>2024-08-25 09:01:02 -0700
commit0a500193087efc96aa3791dc4c2084ef5f6c3c06 (patch)
treee851fc49ef0819d19ee4992608d90f9af66142af /lisp/emacs-lisp
parent713069dd7a87cff8388c25f1bc2c2c1b5217b1ca (diff)
downloademacs-0a500193087efc96aa3791dc4c2084ef5f6c3c06.tar.gz
emacs-0a500193087efc96aa3791dc4c2084ef5f6c3c06.tar.bz2
emacs-0a500193087efc96aa3791dc4c2084ef5f6c3c06.zip
Indent ERT failure explanations rigidly
This also affects the listing of `should' forms produced by hitting the L key on a test button in an ERT buffer. * lisp/emacs-lisp/ert.el (ert--pp-with-indentation-and-newline): Indent the pretty-printed result to match the caller's current column as a reference indentation. * test/lisp/emacs-lisp/ert-tests.el (ert--pp-with-indentation-and-newline): New test. (Bug#72561)
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/ert.el5
1 files changed, 2 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index 2d96e5ce5a9..105c44d49aa 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -1317,13 +1317,12 @@ empty string."
"Pretty-print OBJECT, indenting it to the current column of point.
Ensures a final newline is inserted."
(let ((begin (point))
+ (cols (current-column))
(pp-escape-newlines t)
(print-escape-control-characters t))
(pp object (current-buffer))
(unless (bolp) (insert "\n"))
- (save-excursion
- (goto-char begin)
- (indent-sexp))))
+ (indent-rigidly begin (point) cols)))
(defun ert--insert-infos (result)
"Insert `ert-info' infos from RESULT into current buffer.