Fork me on GitHub
#cider
<
2019-04-14
>
agile_geek11:04:40

@tsulej I think you need cider-pprint-eval-last-sexp-to-comment (bound by default to, take a deep breath, C-c C-v C-f C-c C-e... phew!)

tsulej11:04:39

it prints result of the evaluation not *out*

agile_geek11:04:12

(with-out-str (print "something\nanything"))
;; => something
;;    anything

agile_geek11:04:29

you can't avoid the mapping out to string

tsulej11:04:39

well... I believe I tried it yesterday...

agile_geek11:04:50

otherwise it just evals to nil

tsulej11:04:01

let me check 🙂

agile_geek11:04:58

You may have tried cider-eval-defn-to-comment

agile_geek11:04:43

which maintains the \n characters but again the pprint needs to be eval'ed to a string for this to work

agile_geek11:04:57

There's no way I know of to get the results of out to a comment without wrapping out to convert it to a string using with-out-str

tsulej11:04:52

I have no problem with wrapping but unfortunately I'm getting the following:

tsulej11:04:56

(with-out-str (print "something\nanything"))
;; => "something\nanything"

tsulej11:04:48

maybe I have some parameters set up. Cider used: [cider/cider-nrepl "0.21.2-SNAPSHOT"]

tsulej11:04:19

CIDER 0.22.0snapshot (package: 20190331.2014)

agile_geek11:04:21

Odd I get the result above

tsulej11:04:40

Your result gives me a hope 🙂

agile_geek11:04:03

What version of cider areu on

tsulej11:04:32

what is yours?

tsulej11:04:14

I'm sure it worked month ago, so maybe latest version of cider broke the thing

agile_geek11:04:49

mines 0.18.0 still

tsulej11:04:46

ok, I'll issue a ticket then

tsulej11:04:11

ok, achieved it by making this:

(set! nrepl.middleware.print/*print-fn* (fn [v o]
                                          (binding [*print-readably* nil]
                                            (print-method v o))))

tsulej11:04:40

any easier way to do this? maybe @bozhidar