Fork me on GitHub
#emacs
<
2020-01-09
>
joelkuiper10:01:44

This was probably asked before, but I can no longer find it ... how do you prevent cider from stealing focus from the repl when an exception occurs?

joelkuiper10:01:14

now when I make a mistake (which I sometimes do :p) my whole window layout changes and the focus is on the stack trace buffer, which kinda breaks the flow of things

practicalli-john11:01:27

Are you aware that pressing q closes the stack trace buffer and restores your window layout (I dont know how to prevent the stack trace popup. I like to know when there are errors :))

joelkuiper11:01:50

I don't mind the popup, it's just the focus stealing that I'd like to prevent. But yeah q works, or wind-move back 🙂

joelkuiper11:01:55

I'll take a look at the docs! thanks

joelkuiper11:01:30

(setq cider-auto-select-error-buffer nil)
seems promising

👏 4
joelkuiper11:01:26

yep that did the trick, cool. Much better!

ddellacosta16:01:25

I'm still struggling with getting a CLJS repl going in cider with leiningen, unfortunately. I've removed everything in my .dir-locals and commented out all dependencies relating to cider (piggieback, figwheel-main, etc.) in my .lein/profiles.clj to try to get my setup up as "vanilla" as possible to match the docs. I can confirm that dependencies are getting injected per cider-inject-dependencies-at-jack-in. What I'm seeing is trying to load Clojure dependencies when I run cider-jack-in-cljs in my `*Messages*` nrepl log in emacs:

#error {
 :cause Could not locate myapp/core__init.class or myapp/core.clj on classpath.
 :via
 [{:type .FileNotFoundException
   :message Could not locate myapp/core__init.class or myapp/core.clj on classpath.
   :at [clojure.lang.RT load RT.java 463]}]
 :trace
 [[clojure.lang.RT load RT.java 463]
...
...and then I see (in *Messages*)
error in process filter: user-error: No figwheel-main build files (<build-id>.cljs.edn) were found
error in process filter: No figwheel-main build files (<build-id>.cljs.edn) were found
I get a Clojure repl started up for some reason but no CLJS repl. I'm really confused as to what I'm doing wrong at this point. If anyone has any suggestions I'd appreciate it.

ddellacosta16:01:35

oh versions are: cider-20200101.839, nrepl 0.6.0 (via injection), piggieback 0.4.2 (injected), cider-nrepl 0.23.0-SNAPSHOT (injected)

ddellacosta16:01:14

I'm guessing at this point that there's something in this old, crufty project.clj that's interfering with cider's repl startup somehow, I'm just not sure where to start to figure out what that may be

bozhidar17:01:21

@ddellacosta Could it be that you’re starting the right profile and that’s why some things are missing for you?

bozhidar17:01:09

Also - what’s your version of figwheel-main?

ddellacosta18:01:02

@bozhidar It may be that I haven't configured figwheel-main correctly--I assumed also that it would get loaded in by default. Do I need to set that up explicitly? Does the version of figwheel set up in my project.clj for unrelated dev purposes determine that, or am I offbase? Apologies for what may be stupid questions

ddellacosta18:01:13

I've just added [com.bhauman/figwheel-main "0.2.3"] to my :dependencies in the user profile in ~/.lein/profiles.clj and nothing changed, fwiw

bozhidar18:01:09

@ddellacosta Well, if it’s on your classpath after cider-jack-in then it should work. I’m assuming that you’ve also added figwheel-sidecar or whatever the nREPL integration package was named.

ddellacosta18:01:58

let me confirm

ddellacosta18:01:59

added [figwheel-sidecar "0.5.18"] to my user profile, trying again now

bozhidar18:01:59

Or perhaps this was needed only with the old figwheel. I haven’t tried it in a while and I don’t remember the details. @manuel wrote this article with some info a while ago http://manuel-uberti.github.io/programming/2018/08/03/figwheel-main/

ddellacosta18:01:19

okay, will check it out

ddellacosta18:01:47

yeah that doesn't help. Anyways maybe that article has the secret sauce

bozhidar18:01:44

As for those build files - I assume you have to have them. That error is coming from a check in CIDER.

bozhidar18:01:41

I’m not sure if they are mandatory or not, but it seems we’ve made them required in CIDER. I’m not very familiar with figwheel, I just accepted a PR implementing parsing the build files to provide the users with a list of target builds.

ddellacosta18:01:07

Okay. Yeah I think the CLJS documentation may not be clear enough for how to get this going--reading it it sounds like cider will do most of the work for you if you simply run cider-jack-in-cljs, but it seems like that's not the case. Hopefully I get this working and I can suggest some doc changes, assuming I determine I'm not just doing something stupid

bozhidar16:01:58

Sorry about the confusion. I’ll try to clarify the documentation on subject.

ddellacosta17:01:43

Thanks, I appreciate it! Will update if/when I figure anything out on my end

dpsutton18:01:21

can i suggest again that you get this running completely independently of CIDER and only then attempt with CIDER?

bozhidar09:01:36

I think he’s running in the problem we’ve discussed a while ago that it was a bad idea to make the existence of figwheel build files mandatory. Guess there should be some fallback in case there are no of those.

ddellacosta18:01:48

I'm not sure what you're suggesting. I can get a figwheel repl running with this project just fine. Is there something else I'm missing here?