Fork me on GitHub
#cider
<
2020-11-08
>
dorab00:11:48

I want to NOT switch to the REPL buffer on insert. So I set (via customize) cider-switch-to-repl-after-insert-p to nil in my ~/.emacs.d/init.el file. That works (in the sense that the cursor stays in the source buffer, when I do C-c M-p). However, it says that this variable is deprecated and that I should use cider-switch-to-repl-on-insert instead. However, when I set cider-switch-to-repl-on-insert to nil via customize in my ~/.emacs.d/init.el that does not work (in the sense that my cursor does shift to the REPL buffer). Any ideas what I might be doing wrong?

bozhidar08:11:10

What version are you on? I see we have only cider-switch-to-repl-on-insert these days.

bozhidar08:11:41

Ah, I see what's wrong. Actually we have two defcustoms in the code for this. I'll fix it.

dorab16:11:58

@U051BLM8F Thanks. I am on the latest stable release.

dorab16:11:43

cider version 0.26.1

dpsutton01:11:30

I think you want to ignore the deprecation warning. I think I may have gotten that backwards. After insert is the newer one. On insert was ambiguous and deprecated

bozhidar08:11:01

I don't see a deprecation warning at all in the code, but I'm pretty sure cider-switch-to-repl-on-insert is the name of the defcustom.

bozhidar08:11:00

My bad. I found the actual problem. The old defcustom is still around.

dpsutton08:11:55

i think i did the deprecation backwards yeah

bozhidar08:11:56

Nope, you did it right. I double-checked with the changelog and what's actually used in the code.

parens 3
nmkip02:11:51

Hi, I'm trying to run Reveal with cider using tool.deps but I'm stuck. I added this to my global deps.edn

:reveal-nrepl
  {:extra-deps {vlaaad/reveal {:mvn/version "RELEASE"}
                nrepl/nrepl   {:mvn/version "RELEASE"}}
   :main-opts  ["-m" "nrepl.cmdline" "--middleware" "[vlaaad.reveal.nrepl/middleware]"]}
and I created a .dir-locals.el in the project I'm trying to run Reveal.
((clojure-mode . ((cider-clojure-cli-global-options . "-A:reveal-nrepl"))))
When I run cider-jack-in-clj this is what gets executed:
/usr/local/bin/clojure -A:reveal-nrepl -Sdeps '{:deps {nrepl {:mvn/version "0.8.1"} refactor-nrepl {:mvn/version "2.5.0"} cider/cider-nrepl {:mvn/version "0.25.3"}}}' -m nrepl.cmdline --middleware '["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"]'
Shouldn't the middleware vector contain vlaaad.reveal.nrepl/middleware ? Am I missing something? I also tried "-M:reveal-nrepl" in the .dir-local.el file.

dpsutton02:11:49

I doubt main opts from a profile get mixed together like that. They certainly aren’t merged. Use a prefix Arf when jacking in and just add the profile and args there. I think there are some args you can adjust but don’t know them offhand

nmkip03:11:08

How do I do that? 😛

dpsutton03:11:37

Hit control-u m-x cider-jack-in and it will let you edit the jack in command

nmkip03:11:01

I'll try, thanks! Do I have to do that every time? Or is there a way to automate it?

practicalli-johnny09:11:48

Cider connect is a simpler approach. Jack-in dependencies over-rides the aliases I raised this issue and suggested fix, but haven't had any feedback as to if this would be an okay fix https://github.com/clojure-emacs/cider/issues/2922 Switching off the dependencies for jack-in and still use an alias via a global options variable in dir-locals requires setting several variables

((clojure-mode . ((cider-preferred-build-tool . clojure-cli)
                  (cider-clojure-cli-global-options . "-M:lib/cider-nrepl:inspect/rebl:middleware/nrebl")
                  (cider-jack-in-dependencies . nil)
                  (cider-jack-in-nrepl-middlewares . nil)
                  (cider-jack-in-lein-plugins . nil)
                  (cider-clojure-cli-parameters . ""))))
If the suggested fix is acceptable, this could be replaced by a single variable, to switch off the auto-injection

theeternalpulse16:11:10

sometimes when I'm jacked in to a shadow-cljs session, I can do eval in the buffer, and sometimes I can't. At first i thought it was because there was an error, so I'd refresh and see if one is thrown, but now I'm just eval-ing either gives me nothing (in a cljs file) and it always returns nil in a clj file that I'm using for a macro.