Fork me on GitHub
#cider
<
2019-09-13
>
bozhidar09:09:08

> 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?

bozhidar09:09:22

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

bozhidar09:09:50

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

bozhidar09:09:25

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

bozhidar09:09:57

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.

bozhidar09:09:59

There’s more on the subject here.

bozhidar09:09:01

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.

simonkatz10:09:02

(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 http://blogish.nomistech.com/how-to-comment-in-clojure/

bozhidar10:09:25

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.

simonkatz14:09:24

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.)

dpsutton14:09:56

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)

simonkatz14:09:58

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.)

simonkatz14:09:25

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

simonkatz14:09:57

I’ve tried earlier versions of that too.

dpsutton14:09:02

And do you have piggieback in the mix?

dpsutton14:09:44

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

dpsutton14:09:12

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

👍 4
simonkatz14:09:02

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

bozhidar14:09:32

> 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.

simonkatz15:09:01

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).

simonkatz15:09:25

Thanks for the help and comments.

dpsutton15:09:54

Does shadow wrap the handlers like piggieback does?

bozhidar15:09:12

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
simonkatz18:09:35

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?)

simonkatz18:09:34

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?

rschmukler22:09:55

Hey all! I'm in the process of upgrading https://github.com/Foxboron/HyREPL 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?