Fork me on GitHub
#cider
<
2021-08-06
>
mhcat10:08:27

Is it possible to fully unload cider after a buffer has loaded, such that inf-clojure will work without collisions? Or is it best to just find a way to avoid loading cider in the first place, in the clj files for which you want to use inf-clojure?

dpsutton13:08:57

I’ve got something for this. Let me find it

dpsutton13:08:10

i can't find the snippet any longer. It was largely (remove-hook 'clojure-mode-hook #'cider-mode) to prevent buffers from pulling up cider, and then you can loop over the buffers in the buffer list and when they have cider mode active remove cider

mhcat16:01:34

ahahaha thanks for that, I just logged in for the first time since I wrote this question 🙂 But that's a good answer, so thank you

dpsutton16:01:36

(defun personal/unhook-cider ()
  (seq-doseq (buffer (buffer-list))
    (with-current-buffer buffer
      (cider-mode -1))
    (remove-hook 'clojure-mode-hook #'cider-mode)))

dpsutton16:01:38

just found it

dpsutton16:01:11

the remove-hook can probably be spit out of the seq-doseq looking at it now

mhcat16:01:12

definitely, but harmless as is

mhcat16:01:17

thanks again

mhcat16:01:01

I guess for switching back to CIDER, the same thing with inf-clojure!

mhcat16:01:22

assuming it follows the same pattern (which coming from the same stable etc..)

dpsutton16:01:01

i haven’t found the need to write that version yet 🙂

dpsutton16:01:08

but yeah it should be similar

Jakub Šťastný11:08:17

That's a good question, I'd also like to know the answer (in my case, I'm interested in running socket REPL in some scenarios, for instance so I can have nested sessions to be used essentially as a debugger (and yes, I know cider has got an actual debugger, I just prefer this).

Carlo11:08:52

hey, where's the variable that holds the default command for cider-jack-in?

djm12:08:27

There isn’t a single one. But if it’s a lein project, it’ll use cider-lein-command, cider-lein-parameters, cider-lein-global-options, cider-jack-in-dependencies, cider-jack-in-lein-plugins, and probably some others

djm12:08:17

Does that help?

Carlo13:08:46

thanks @U015KH5ENEM, it's not a lein project, I'm trying a projectless workflow, and my repl is invoked via the clojure cli tools. The one I usually have (and can edit via the universal argument) is:

/run/current-system/sw/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} refactor-nrepl/refactor-nrepl {:mvn/version "2.5.1"} cider/cider-nrepl {:mvn/version "0.25.9"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}}}' -M:cider/nrepl
but I want to add a couple more flags automatically

Carlo13:08:19

I can find 3 setting mentioning clojure cli: cider-clojure-cli-global-options -> nil cider-clojure-cli-command -> clojure cider-clojure-cli-aliases -> nil So I'm unsure where the big command is

djm13:08:45

Some of the ones I mentioned aren’t lein-specific

djm13:08:06

Oh, maybe just one of them: cider-jack-in-dependencies

djm13:08:08

It looks like cider-jack-in-lein-plugins is used for cli too

Carlo13:08:54

in the end I was able to get what I wanted via cider-clojure-cli-global-options! Thanks @U015KH5ENEM 🎉

djm13:08:15

Great! No problem