Fork me on GitHub
#cider
<
2021-12-20
>
Robert A. Randolph18:12:23

Reading https://docs.cider.mx/cider/1.1/usage/pretty_printing.html it is unclear to me if I should expect (setq cider-print-fn "") to work with the latest cider. I attempted to use this setting and it appears to not work, as pr is still being used.

dpsutton18:12:34

that documentation lists possible values for cider-print-fn. The empty string is not one of them so I’m not sure what you are trying to do

Robert A. Randolph18:12:39

My apologies, my speech-to-text failed there. Setting it to any value listed on that page does not appear to work.

Robert A. Randolph18:12:34

Setting it to an invalid value does not throw an error either.

dpsutton18:12:45

ah ok. i’d file a bug report then. And probably the easiest way to confirm and demonstration the it does not work would be with the custom version. Because there is a custom var version, i’m not sure how we could really define an invalid value

dpsutton18:12:44

but a minimal repro in a ticket with a custom printer

(defn custom-printer [value writer options] (.println writer ^String "custom value"))
and set that. Would be pretty conclusive if it worked or not

dpsutton18:12:39

(as it can be hard to distinguish between if fipp or pprint are actually working

Robert A. Randolph18:12:10

Hmm, interesting. (setq cider-print-fn 'true) does throw an error when attempting to pprint.

Robert A. Randolph18:12:24

Ok, I'll mess with this more. I just wanted a quick sanity check to set my expectations.

dpsutton18:12:41

what about (setq cider-print-fn "true"). that might just be a type error on string vs symbol

dpsutton18:12:57

and then the string is just ignored when it actually matters

Robert A. Randolph18:12:39

"true" succeeds in printing

Robert A. Randolph18:12:11

I would expect that to fail

Robert A. Randolph18:12:28

hmm, default value is "pprint", and it's not using pprint by default. Docs say it should be using what's bound to nrepl.middleware.print/*print-fn*, which is pr by default.

bozhidar07:12:28

As mentioned on the ticket - looking at the code you should get some error in the nREPL log, but it will just pick fallback to the default if you supply a function that won't resolve. The printing behavior does change when using the built-in cider-nrepl functions, so it seems to be working.

dpsutton18:12:40

for sure a bug report then

👍 1