Function: helpful--pretty-print
helpful--pretty-print is a natively compiled function defined in
helpful.el.
Signature
(helpful--pretty-print VALUE)
Documentation
Pretty-print VALUE.
If VALUE is very big, the user may press C-g (keyboard-quit) to
gracefully stop the printing. If VALUE is self-referential, the
error will be caught and displayed.
Source Code
;; Defined in /nix/store/mvfc1hll8a1f23ivm3qmzj4bn64jr3x7-emacs-packages-deps/share/emacs/site-lisp/elpa/helpful-20250408.334/helpful.el
(defun helpful--pretty-print (value)
"Pretty-print VALUE.
If VALUE is very big, the user may press \\[keyboard-quit] to
gracefully stop the printing. If VALUE is self-referential, the
error will be caught and displayed."
;; Inspired by `ielm-eval-input'.
(condition-case err
(s-trim-right (pp-to-string value))
(error
(propertize (format "(Display error: %s)" (cadr err))
'face 'font-lock-comment-face))
(quit
(propertize "(User quit during pretty-printing.)"
'face 'font-lock-comment-face))))