This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # beginners (7)
- # cider (128)
- # clara (9)
- # clojure (7)
- # clojure-norway (3)
- # clojure-spec (2)
- # clojure-uk (16)
- # clojurescript (79)
- # css (1)
- # datomic (2)
- # devcards (1)
- # editors (39)
- # euroclojure (4)
- # events (1)
- # figwheel (25)
- # fulcro (1)
- # luminus (3)
- # off-topic (15)
- # om (3)
- # onyx (10)
- # protorepl (8)
- # reagent (5)
- # reitit (1)
- # shadow-cljs (95)
- # tools-deps (6)
On the subject of the style guide - PRs and issues are always welcome. It’s really hard to get a consensus on some points, so in the end there’s bound to be someone unhappy with certain decisions that were made. 🙂
> I tend to argue these things a lot, because it’s often the case that what people think of as “what lisp needs to do” often boils down to “that’s what emacs does, and it’s hard to change”
@cfleming I don’t believe this is a completely fair assessment of the situation, though. Nothing’s really hard to change, there’s simply no one to change it. I’m working on half the tooling projects for Clojure + all the Emacs stuff (for free) and there’s a hard limit to what I can do.
I get your perspective, but I also get very annoyed that many people just complain about the current situation and do nothing to help…
Lisp history and personal preferences aside I’m open to making whatever changes are needed for better cross-editor collaboration, but I simply don’t have time for all of this and have to focus on the most important things (e.g. rolling out the new nREPL to everyone, etc).
Btw, just released Orchard 0.3 - the only important change is the var info functionality from cider-nrepl was extracted to orchard.
And yeah - formatting is hard. Having worked a lot on Ruby and Clojure formatters I really hate dealing with this at this point. 😄 Btw, what is
clj-format? I’m normally using
cljformat and it seems to handle the 1-space indentation just fine.
(and that’s btw a good example of something non-standard in Emacs (every other lisp mode uses 1-space indent and that has been historically the norm for Elisp, Common Lisp, Scheme and Racket) we made configurable just in the spirit of collaboration with others)
What do you mean by
cljformat seems to handle 1-space indentations just fine, @bozhidar? Is
cljformat the same as
Well, I use this in most of my projects and it doesn’t break the indentation, so I guess it handles this case fine.
I am trying to see how Cider handles it. It seems to be using
cljfmt defaults by default. Is that right? I am looking here: https://github.com/clojure-emacs/cider-nrepl/blob/b479d674e3261a9c067d163325bd2689eb8f7dc4/src/cider/nrepl/middleware/format.clj
The reason I want to know is to try make Calva Formatter format the same way as Cider does, by default. So that teams where both vscode and emacs is used should by default have the code formatted in the same way.
Yeah, although CIDER also has it’s own indentation engine, which you’d be using normally
The idea is that you can alternative rebind the indentation stuff to use
cljfmt if you work in some cross-tool environment.
I don’t really use cljfmt from CIDER, I just add it to the CI of my projects and fail the build on inconsistencies.
That sounds like it means that the indentation engine takes similar decisions as
You can see the section on “dynamic indentation” in
cider-mode.el, but it’s not just this. CIDER just builds indentation rules for
clojure-mode.el using this specification https://github.com/clojure-emacs/cider/blob/master/doc/indent_spec.md
clojure-mode.el’s indentation is partially derived from
lisp-mode.el, so the implementation is not self-contained.
Thanks! Code formatting really is more complex than one thinks even after having pondering it some time. :face_with_cowboy_hat:
One more question. This indentation engine. Does it do more than just indentation? I mean, does it reformat the code in other ways, than choosing the indentation for each line?
@bozhidar Sure, I understand, and I understand that some stuff is just hard to change because it comes from the underlying lisp mode or whatever.