Fork me on GitHub
#cider
<
2021-06-09
>
Daniel Slutsky14:06:34

Hi. Assume that I want to send some information to the CIDER REPL before every evaluation. More concretely, I want to extend CIDER so that it will send to the REPL process the whole contents of the currently edited buffer (as a String), just before any piece of code is evaluated. • Is it a bad idea for some reason? • Is there a hook for doing something before every evaluation? (couldn't find one)

jumar18:06:58

That sounds like you’re typing into the repl buffer instead of typing into the file buffer which is usually recommended

Daniel Slutsky21:06:49

Thanks @U06BE1L6T! I'm typing into the file, but want the REPL to know about the exact file contents.

jumar03:06:29

Why not just evaluate the whole buffer?

Daniel Slutsky07:06:20

Oh, I need to create an up-to-date html page that shows the code of the whole namespace, every time we the user evaluates anything (working on the next version of the Notespace tool).

bozhidar18:06:28

I don't think there's a hook for this, but there's some functionality that auto-evals the ns form before eval, that you can potentially copy/extend for your purposes.