EDIT: Indeed, as people on Reddit pointed out, installing Lein is simply downloading a script and running it. Installing CIDER from MELPA was also easy. The two, however, aren’t completely compatible at the moment because CIDER from MELPA wants nREPL 0.2.7 at least and Lein only pulls in 0.2.6 (even though, I believe the current is 0.2.10).
It has been five years since I last tried Clojure. I feel like I should try it again.
I don’t want to beat my head against Leiningen for even ten minutes this time. Is there some way to reasonably use Emacs + Clojure without have to install and configure CLASSPATHS and Mavens and Ants and JDKs?
It seems SWANK-CLOJURE has been deprecated in favor of CIDER. The CIDER doc says how to configure Leiningen or Boot for use with CIDER. Is there some way that I can avoid Leingingen and Boot? Or some way that I can click one ‘Install’ button and have Leiningen and Boot work?
Well, for Leiningen it is enough to download that script and run it (lein repl). It will download necessary libraries and start REPL.
For running it inside emacs, you have two options:
1) set ‘inferior-lisp-program’ to point to ‘lein repl’ and it will work with ‘(run-lisp)’
2) run CIDER or Monroe (https://github.com/sanel/monroe). CIDER has more features, but Monroe is simple to install and behaves like inferior-mode
Both CIDER and Monroe connects via network REPL protocol (nREPL) and when you start Clojure repl with ‘lein repl’, it will also automatically start nREPL server you can connect to.
Truth to be told, downloading lein script and running without thinking about dependencies is the simplest thing possible.
You could try ClojureScript instead. It’s the same language after all. The latest quick start guide shows you have to get started entirely Leiningen-free, if that is what bugged you last time.
https://github.com/clojure/clojurescript/wiki/Quick-Start
Wow, you’re going at it the wrong way. You’ll have a self fulfilling prophecy of a bad experience with that attitude. Did you install, and most importantly, configure your emacs with “one click” in the first place? Enjoy your trolling.
No, I didn’t configure Emacs with one-click. However, with one-click, I had an Emacs that I could use. Five years ago, I spent three days trying to get all of Leiningen’s dependencies installed and even after getting it installed, it seemed to need multiple copies of Maven and Clojure all around my directory hierarchy and tons of configuring CLASSPATHs every time I sneezed.
Also, of the five Common Lisp implementations on my machine, all are pretty much one-click or untar installs. Only one has a pre-requisite (and that is for a C/C++ compiler). And, I have one package manager that they all share.
You might like this one:
http://www.braveclojure.com/using-emacs-with-clojure/
I’d suggest giving leiningen another try, it’s come a very long way in 5 years and doesn’t require any external dependencies except for a JDK now (it will download the other things it needs automatically and store them in your local repository, similarly to how Scala sbt works). You can get it on OS/X via “brew install leiningen” or I use this PPA on ubuntu: https://launchpad.net/~gautambt/+archive/ubuntu/leiningen2. Or you can just download the bash script and install it on your PATH somewhere.
Lein is essentially a one-click install (apart from the JDK) that will give you everything you need for development including the Clojure compiler. If you don’t use it you’ll probably spend more time dealing with classpath issues and java command-line options.
As a follower of your common-lisp projects, I’m looking forward to seeing what you build with Clojure!
I’m using emacs with nrepl (using lein for projects), first I open file in some project and then “nrepl-jack-in”, after that it’s almost CL+emacs experience.
I’ve tried to setup CIDER but no luck
Maybe this StackOverflow thread can help you with the nREPL warning: http://stackoverflow.com/questions/28688721/how-to-upgrade-nrepl-version-of-leiningen
It did not. However, I am told it would have done the right thing for some reason if I had started Leiningen in a directory containing a project without even needing to mention CIDER or nREPL in the project dependencies.
I opted to downgrade CIDER back to “melpa-stable” version 0.8.2.
I find Leiningen’s (or Clojure’s) obsession with “projects” distracting, to put it mildly. CIDER had this problem, too. With various different profiles.clj combinations, I never got a REPL at all in CIDER. If I tried M-x cider-quit, it would hang Emacs. If I killed the Leiningen process from a shell, then CIDER would come back enough to use Emacs, but then M-x cider-jack-in wouldn’t try starting a REPL any longer complaining there was no project.
Sorry for your problems.
Does Leinigen allow you to specify the version of nRepl you want to use?
Yes, and it downloads that version, it just uses its own version anyway.
how very odd. i wonder if others have come up against the same. any forums for leinigen or cider?