Fork me on GitHub
#emacs
<
2023-02-21
>
xificurC09:02:56

if I have a clj and a cljs repl cider operations are set up to be sent to both repls. E.g. cider-load-buffer calls (cider-map-repls :auto ...) which auto-resolves to both repls. I'd like to control where commands are sent, preferably by setting an "active" type myself. Has someone done this already? Do I have to advice around cider-map-repls?

Benjamin15:02:04

(setq-default cider-merge-sessions nil)
and then "select" by visiting the window you want to eval with. The latest active buffer is the one that is used. For me, after getting used to this it solves this selecting nicely, because I am already good at selecting buffers/windows. There is a similar trick in dired when setting
dired-dwim-target #'dired-dwim-target-recent
In practice I might end up with a window config of having the 2 repls open above each other somewhere, then switching windows to the repl I want and back to the source file.

xificurC15:02:40

thanks @U02CV2P4J6S, will take a look! What do you do when you want to eval in both?

Benjamin15:02:48

Oh, that did not happen so much to me yet. I guess I did not work in cljc code bases a lot yet. Currently, I would select each manually and eval but I get that if you do that a lot you don't want to do that. Maybe dynamically set cider-merge-sessions to 'project in a custom function like cider-eval-all

xificurC15:02:30

I don't think I often do that either, just wanted to know if you have a solution if I switch to this setup

👍 2