Fork me on GitHub
#emacs
<
2023-05-09
>
respatialized18:05:01

Has anyone set up cider and Emacs to "conditionally save" a buffer? I'm wondering if I can set things up with a custom fn so that my buffer only gets saved if it evaluates successfully. The variable cider-save-file-on-load is close to what I want if I set it to t, but it seems to save before, rather than after, loading the buffer.

Ellis18:05:36

Put whatever condition you want in a before-save-hook

2
respatialized18:05:40

so if I have a hook set up to evaluate before save, if CIDER throws an error when evaluating the buffer, then the save won't run, correct?