cider

2025-01-20T19:18:18.101539Z

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?

Kirill Chernyshov 2025-01-20T19:41:55.367069Z

cider-pprint-eval-last-sexp if I remember correctly this should print the result to the comment below the form

2025-01-20T19:43:09.138219Z

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

a13 2025-01-20T19:46:46.326369Z

does wrapping in with-out-str help?

2025-01-20T19:49:32.793629Z

No, cause that overwrites the evaluation. I'd like this:

(do (println 1)
    (println 10)
    100) ;> 1
         ;> 10
         => 100

2025-01-20T19:49:54.170909Z

Where as now if you eval in cider you get:

(do (println 1)
    (println 10)
    100) => 100

Macroz 2025-01-20T19:56:06.474489Z

I 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.

2025-01-20T20:38:17.190299Z

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.

2025-01-20T20:38:27.474789Z

And that way I would not need to ever use the REPL buffer

Macroz 2025-01-20T20:43:23.027849Z

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.

2025-01-20T20:51:35.886929Z

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

👍 1
Macroz 2025-01-20T20:54:58.038189Z

Not clickable, but from keyboard, yes sure. I do use inline eval all the time too and it would be nice.

Macroz 2025-01-20T20:59:44.651879Z

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.