I'd like to pprint a data structure, where the whole thing is printed indented. (As if, for example, I was already some levels deep).
(pprint x)
{:foo ...
:bar ...}
(pprint-with-indentation x)
{:foo ...
:bar ...}
I tried calling pprint-indent
before pprint
, but that didn't work (or I was using it wrong!)
Stel commented with a solution of adding the indentation after running pprint. This would certainly work; I was looking more specifically to ask if there was a way to get pprint to do it (so that the output would continue to conform to *print-right-margin*
etc. without adjusting the margins myself). Of course, if there isn't a way to do that, Stel's solution is a good workaround.
Any ideas of what I could try?
Thanks!
Andrew