Comment made by: neapel
More bad news!
Manually creating a pretty-writer doesn't do the trick either, because it is not being properly flushed:
user=> (binding [*out* (get-pretty-writer *out*)] (cl-format true "hello ~_world~%"))
hello world
nil
user=> (binding [*out* (get-pretty-writer *out*)] (cl-format true "hello ~_world"))
hellonil
user=> (binding [*out* (get-pretty-writer *out*)] (cl-format true "hello ~_world") (.ppflush *out*))
hello worldnil
The ~%
inserts an unconditional newline like {{\n}}, which also works as expected.
Insert \~\_
before and it only prints up to that one. But I've also managed to get it to abort at other \~\_
s, maybe because other commands flushed it.
Manually flushing it, like the inexplicably private {{with-pretty-writer}} macro does works though.
I don't understand why {{get-pretty-writer}} is exposed but not the macro that is needed to use it properly. Also all functions using pretty-writer facilities should use with-pretty-writer, that's what it appears to be specifically designed for. Then there's no need to expose it (or get-pretty-writer).