Fork me on GitHub

I've found an interesting way how to temporarily modify the code of 3rd party clojure library (e.g. for debugging purposes - adding println statements, etc.) and apply the changes to current REPL. Let's take as an example clj-http library: 1. run cider-open-classpath-entry 2. search for clj-http; open (ENTER) 3. search for namespace, e.g. clj_http/core.clj; open (ENTER) 4. search for function of interest, e.g. get-route-planner modify 5. eval in cider repl - answer "n" to question "File ... is read-only on disk. Make buffer read-only, too?"


I wonder if anyone else ever do similar stuff and whether there's a more reasonable/convenient approach to do this


@jumar I do this regularily. But I use M-. to go to the source of the function/macro in question and C-x C-q to make the buffer writeable.


@hans this is much easier. Thank you!


@jumar also, i use C-M-x to evaluate the form that I'm currently editing in a buffer. no need to deal with the repl, really


I use that too (eval buffer or eval function) - I've just used wrong words ("eval in cider repl") in my former post