I often try to not have the REPL window open, and with inline evaluation I can get pretty far. But I just realized each time I want to see what gets printed I need to open it. Is there a feature so it can also show the print inline similar to how it shows results inline?
cider-pprint-eval-last-sexp if I remember correctly this should print the result to the comment below the form
Right, that's not quite what I'm looking for. I want something that takes what is sent to out and will display it in a overlay similar to inline evaluation
does wrapping in
with-out-str
help?
No, cause that overwrites the evaluation. I'd like this:
(do (println 1)
(println 10)
100) ;> 1
;> 10
=> 100
Where as now if you eval in cider you get:
(do (println 1)
(println 10)
100) => 100I think I used to do the same like this https://github.com/clojure-emacs/cider/issues/2580 Eval stuff not inline but to new buffer, and I would get the printing into the same.
Ah, I see. I don't even want pretty print, I just want out to also get shown alongside the evaluation result. errors popup as a cider error, so I don't need those.
And that way I would not need to ever use the REPL buffer
Yup. Pretty printing is slightly beside the point. The problem is rather that various features are not orthogonal, and can't be combined so easily. Inline eval doesn't work for big values. Other buffer / inspector is better in those cases. And the same applies for more printing.
Ya, but I think it would be an awesome feature. You can truncate, and on click open up another buffer more appropriate for long values.
(do (println 1)
(println super-long-ds)
100) ;> 1
;> [1 2 3 4 5 5 6 6 4 3 4 4 5 6 6 7 8 ...]. <-- This is clickable to open in inspector or in REPL window where the whole thing was printed
=> 100
Not clickable, but from keyboard, yes sure. I do use inline eval all the time too and it would be nice.
Printing is an unfortunate thing though. There are often conflicts with platform/framework/library printing and app code. Ideally there would be outputs (including tap>), where you could send stuff (not just strings), and you'd have places where you gather and show that stuff, even as overlay in code buffer, other window or inspector.