cider

A channel dedicated to the Clojure Interactive Development Environment that Rocks (aka CIDER). :cider:
dorab 2020-11-08T00:15:48.396200Z

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?

bozhidar 2020-11-08T08:03:10.406900Z

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

bozhidar 2020-11-08T08:13:41.407500Z

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

dorab 2020-11-10T16:09:58.422Z

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

dorab 2020-11-10T16:10:43.422200Z

cider version 0.26.1

dpsutton 2020-11-08T01:51:30.397400Z

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

bozhidar 2020-11-08T08:04:01.407100Z

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.

bozhidar 2020-11-08T08:14:00.407700Z

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

dpsutton 2020-11-08T08:20:55.407900Z

i think i did the deprecation backwards yeah

bozhidar 2020-11-08T08:31:56.408100Z

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

1
dorab 2020-11-08T02:20:11.398100Z

Thanks @dpsutton.

nmkip 2020-11-08T02:32:51.403300Z

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.

dpsutton 2020-11-08T02:57:49.405400Z

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

practicalli-john 2020-11-08T09:12:48.408400Z

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

nmkip 2020-11-08T03:04:08.405500Z

How do I do that? 😛

dpsutton 2020-11-08T03:40:37.406500Z

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

nmkip 2020-11-08T03:48:01.406700Z

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

theeternalpulse 2020-11-08T16:02:10.410300Z

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.