Skip to content

Commit 9c35c05

Browse files
committed
Extend the pprint section a bit
1 parent 0adad1f commit 9c35c05

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

doc/pretty_printing.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Pretty-printing
22

3+
!!! Note
4+
5+
Pretty-printing was overhauled in CIDER 0.20 to leverage a new feature introduced in nREPL 0.5.
6+
Refer to [nREPL's documentation](https://nrepl.org/nrepl/design/middleware.html#_pretty_printing) for details.
7+
38
You can configure the function used by CIDER for pretty-printing evaluation
49
results and other data using the `cider-pprint-fn` option.
510

@@ -57,3 +62,22 @@ You can pass an options map to the print function by setting `cider-pprint-optio
5762
``` el
5863
(setq cider-pprint-options '(dict "length" 50 "right-margin" 70))
5964
```
65+
66+
!!! Important
67+
68+
Note that each print engine has its own configuration options, so you'll have to make sure that whatever is
69+
in `cider-pprint-options` is something that the engine would understand. If you change the default printer
70+
you'll also have to update accordingly `cider-debug-print-options` and `cider-stacktrace-print-options`.
71+
72+
Here's a table describing the differences in the names for the common print options, supported by every
73+
print engine.
74+
75+
Dynamic Var | pprint | Fipp & Puget | zprint
76+
-----------------------|--------------------|-----------------------|------------------
77+
`*print-length*` | length | print-length | max-length
78+
`*print-level*` | level | print-level | max-depth
79+
`*print-right-margin*` | right-margin | width | width
80+
81+
All printers understand the dynamic variables, so you can also set those in your REPL instead of setting
82+
`cider-pprint-options`. As the debugger and the stacktrace printer normally use a different config you
83+
can't easily avoid not providing configuration for them.

0 commit comments

Comments
 (0)