cider icon indicating copy to clipboard operation
cider copied to clipboard

make cider-scratch functional after writing its contents to a file

Open waffletower opened this issue 5 years ago • 1 comments

I often use dev namespaces for more casual code but dev namespace buffers need to be compilable in entirety. cider-scratch is a nice middle-ground where you can evaluate expressions into the current repl namespace ad hoc and have code fragments and non-code present in the buffer.

However, there isn't a convenient way to persist a cider-scratch buffer without breaking its connection to the REPL. Would like a way to maintain the REPL connection and key bindings (cider-clojure-interaction-mode I believe) after saving the contents to a file with C-x s or equivalent.

I have attempted to switch to cider-clojure-interaction-mode after saving, but I am simply provided a warning message and the cider-scratch REPL connection is lost and the keybindings are not functional.

waffletower avatar May 06 '20 20:05 waffletower

I'm guessing a simple way around the problem would be to have some custom function doing the saving of the scratch buffer to a file (e.g. - one that does this in the background) and a similar custom function to load the contents of a file in a scratch buffer.

bbatsov avatar May 08 '20 07:05 bbatsov

We'll happily accept any PR that makes this particular use case easier.

Because it's been a while, this issue seems best closed.

vemv avatar Aug 21 '23 04:08 vemv