Fork me on GitHub
#cider
<
2019-08-19
>
pieterbreed07:08:10

Hello everyone; sorry to just barge in and ask a question. I recently did a fresh upgrade to emacs 25.2, fresh installs of everything, including the latest and greatest cider. My previous workflow was like this: I'd open the clojure project.clj file, run emacs M-x -jac and all the files in the project would get access to the cider repl. IE Ctrl-c Ctrl-z would jump to repl ecc. The buffers would all be "linked" to the repl I cerated with -jac automatically. After the fresh install, some of the files in my project are not attached to the repl anymore. (Ctrl-c Ctrl-z does NOT work for all of the files). I can't quite understand what the pattern is either. Some files attach automatically and some don't and I can't tell the difference. I also don't know how to link the current buffer I'm visiting to the already-connected REPL. I've read the docs about sesman, and maybe I'm just to dumb, but I don't understand how to achieve the link. I've tried things like M-x sesman-browser in one of the buffers within the same project/file structure, but the error I get is No sesman-system in buffer .... I get the same error when I'm in the buffer and try to run sesman-link-with-buffer. I have no idea what's going on or how to fix it. I can create a new REPL with a sibling-repl, but this is annoying. What do do?

bozhidar10:08:47

@pieterbreed Nothing has been changed with respect to session handling for quite a while now. Which version of CIDER where you using before you upgraded your Emacs?

pieterbreed10:08:03

I can't remember, it's been a while since I updated before that. Once it was stable and I got reasonable used to it, I didn't update until I was forced to recently with a whole bunch of system updates.

pieterbreed10:08:45

I suspect I'm doing something wrong, but I can't figure out what. My assumption is if I run -jac while in the project.clj buffer, all the files in the project structure should automatically attach to the new repl.

pieterbreed10:08:04

At the moment I'm in a situation where I have to create a sibling-repl for every buffer that I open

bozhidar10:08:45

Yes, that’s how it is supposed to work, that’s why I’m surprised by your problem.

bozhidar10:08:10

All project files get attached to the session automatically.

pieterbreed10:08:33

OK, I believe you 🙂 Since that's is not what's happening (for me...) what would you suggest I do for tracking down the issue?

bozhidar10:08:59

I seem to recall that were relying on the classpath to determine what’s in a project, so I’d start by checking your project’s classpath seems correct. (especially the one produced by the jack-in command)

pieterbreed10:08:55

Let me just check if I'm understanding you fully; if the files I'm struggling with make their way into the classpath, then I should expect the cider session to work out? More context; I don't have anything funny going on here. These files I refer to are directly in a clj project (ie they're not from libraries or symlinks or cljs or something else I think is funny). They're just normal files, with the src/ns/ns.clj filepath structure... I'll double check the classpath after jack-in, but I'm not expecting to find a problem there, since it's such a vanilla project.

bozhidar10:08:33

Well, I just test everything on a vanilla project and it works fine for me. That’s why I thought you might have some non-standard setup or something like that.

pez10:08:41

Seems like next logical step would be for @pieterbreed to test it on that same vanilla project. 😃

pieterbreed11:08:52

let me try that

pieterbreed11:08:06

Here's what I did: - Opened ./projec.clj, then ran M-x cider-jack-in, wait for repl to open and verify that it's live (+ 2 3) => 5 - Verified that Ctrl-c Ctrl-z takes me to the active repl and back to project.clj. That buffer's status bar shows the connected cider session. - Opened ./src/orchard/core.clj, noticed that the new buffer don't have the same cider mode status. Ctrl-c Ctrl-z does NOT take me to the REPL, which is in the buffer "next-door"

pez12:08:32

When I do that, also the core.clj buffer works. As in that I can jump back and forth between the repl and the file buffer. I installed Emacs and CIDER pretty recently. Maybe two weeks ago.

pez12:08:19

I am a total Emacs noob, so if you want me to check something up, I might need pretty detailed instructions. 😃

pieterbreed12:08:14

Thanks @pez and @bozhidar. This feels like in the old linux days. X doesn't work, so format and start from scratch. I guess today is the day to try out spacemacs

bozhidar12:08:29

Well, generally adding more complexity when trying to find the core of a problem sounds risky. 😄

pieterbreed12:08:35

OMG - facepalm - Literally right after I posted that it got sorted. My imported init.el referenced aggressive-indent-mode but it wasn't installed yet. Just now installed that, and cider works like it should. Sorry for wasting everyone's time.

pieterbreed12:08:54

Feels exactly like the old linux days 🙂

pez12:08:41

My old init.el made my recent Emacs (Spacemacs) install totally horrible. I first fought the Tao and tried hard to keep at least parts of my precious init code. Then I nuked it and things started to work. It's a lesson I keep needing, I'm embarrassed to admit.

bozhidar12:08:41

My init.el is quite simple and auto-installs everything needed. But then again - this days I don’t much development outside OSS and I don’t need much of the crazy things I’ve needed in the good old days. 🙂

pez13:08:39

My init.el also auto-installed stuff. But I don't think it can be described as ”quite simple”, and also it was three years old and unused when I decided i needed to try something in CIDER...