Fork me on GitHub

> how can I configure emacs/clojure-mode/cider in such a way that it doesn’t indent lines starting with a single semi-colon to the middle of the page?


That’s a classic Lisp convention, not a classic Emacs Lisp convention.


Different types of comments denote different things - ; denotes an inline comment.


Some Clojurists, however, like to use ; everywhere which caused a bit of debate on the subject.


Generally, however, I think it’s a bad idea to dispense with the semantics of different comments just for the convenience of typing less ; characters.


There’s more on the subject here.


Anyways, at some point this will be configurable in clojure-mode, but right now you have to resort to doing some hack if you need it.


(An answer at that link mentions Common Lisp single-semicolon comments starting at column 40, but I’m pretty sure that when I used LispWorks Common Lisp that didn’t happen. But maybe I’d changed some default.) I agree with the different semantics of different numbers of semicolons. For trailing comments, I’d like auto-formatting to do one of two things: (1) leave them as they are, or (2) leave the first of a series as it is and align comments on following lines with the first one. There are more details and examples at the somewhat-opinionated


Great article! I totally agree that the current default for ; to align them at the 40th column is pretty weird and this should probably be improved in general in lisp-mode.


I’ve just started playing with shadow-cljs. I have things working nicely with a cider-jack-in-cljs, but if I try to connect to an existing shadow-cljs nrepl server with cider-connect-cljs I’m hitting problems. Is that something that should work? (Just wondering if I should persevere or give up.)


Does the shadow build your connecting to have the correct dependencies for cider? And are you using the “shadow-connect” reply type when connecting? (I think that’s the right one)


I don’t see “shadow-connect”. How about “shadow-select”? When I try that, I end up with a REPL that sesman-browser seems to think is a CLJ REPL. (But I’m in a slightly strange state at the moment, and probably need to revert some of the hacks I’ve made to try to get things working. For example, I’m using the version of CIDER on master; maybe I should use what my package-list-packages gives me instead.)


My shadow-cljs build has :plugins [[cider/cider-nrepl "0.22.3"]].


I’ve tried earlier versions of that too.


And do you have piggieback in the mix?


this is how CIDER cranks up a shadow project: > Starting server via /usr/local/bin/npx shadow-cljs -d nrepl:0.6.0 -d cider/piggieback:0.4.1 -d cider/cider-nrepl:0.22.0 server


you can see everything involved there. i think cider-nrepl can't talk to a cljs environment without piggieback.

👍 4

OK — thanks. Will look at the docs again too.


> you can see everything involved there. i think cider-nrepl can’t talk to a cljs environment without piggieback. Shadow doesn’t use piggieback, but it emulates its API. And, of course, all the ClojureScript support depends on cider-nrepl.


I have things working — all very nice! I’ve simply added the following to my project.clj:

:profiles {:dev {:dependencies [[cider/cider-nrepl "0.22.0"]
                                  [cider/piggieback "0.4.1"]]
                   :repl-options {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]}}}
I hadn’t understood that I need piggieback on the CIDER side (although not on the shadow-cljs side).


Thanks for the help and comments.


Does shadow wrap the handlers like piggieback does?


The shadow nREPL middleware seems much cleaner to me compared to piggieback. We were actually chatting with @thheller that this can potentially become a simpler alternative to piggieback if someone wants to work in this direction. Or some ideas can be applied to piggieback. Unfortunately that’s beyond my understanding of ClojureScript.

parens 4

I said earlier that I got cider-connect-cljs working with shadow-cljs. It turns out that if I create both a CLJ and a CLJS REPL, things are sensitive to the order in which I create them. If I first connect to shadow-cljs and then create a CLJ REPL (saying yes to the “create sibling?” prompt), all is fine. If I first create a CLJ REPL and then connect to shadow-cljs, things don’t work well. I don’t get asked to “Select shadow-cljs build” and I end up with a REPL whose name has “(clj)” at the end instead of “(cljs)“. My application’s single ns is listed by (all-ns), but (ns-publics 'my-namespace) returns an empty map. If I try to evaluate a form in a CLJS file’s buffer, nothing seems to happen — no value is reported. Perhaps I should raise an issue somewhere. (And if so, would that be for CIDER?)


I should have said: I entered (all-ns) and (ns-publics 'my-namespace) in the REPL buffer.

Ian Fernandez18:09:04

Guys, when I jack-in using emacs

Ian Fernandez18:09:15

I'm having this problem:

clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: No such var: misc/requiring-resolve, compiling:(nrepl/middleware/print.clj:180:21)

Ian Fernandez18:09:21

anyone knows why?


Hey all! I'm in the process of upgrading to work with the latest version of Hy (I think I'm done!)... I'm now trying to test things out using Cider via cider-connect. It looks like cider is expecting a few middleware that are outside of the minimum nrepl spec (I see calls for out-subscribe and init-debugger) and it seems to be breaking either the server or the client. Should cider be working okay without these?