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?
What version are you on? I see we have only cider-switch-to-repl-on-insert
these days.
Ah, I see what's wrong. Actually we have two defcustoms in the code for this. I'll fix it.
@bozhidar Thanks. I am on the latest stable release.
cider version 0.26.1
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
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.
My bad. I found the actual problem. The old defcustom is still around.
i think i did the deprecation backwards yeah
Nope, you did it right. I double-checked with the changelog and what's actually used in the code.
Thanks @dpsutton.
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.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
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-injectionHow do I do that? 😛
Hit control-u m-x cider-jack-in and it will let you edit the jack in command
I'll try, thanks! Do I have to do that every time? Or is there a way to automate it?
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.