Leiningen
Download the lein script and set it to be executable (chmod a+x ~/bin/lein), then add it in your “$PATH” environment variable. Run it to install lein with clojure.
emacs24
Refer here :
1 2 3 4 5 6 7 sudo apt-get purge emacs-snapshot-common emacs-snapshot-bin-common emacs-snapshot emacs-snapshot-el emacs-snapshot-gtk emacs23 emacs23-bin-common emacs23-common emacs23-el emacs23-nox emacs23-lucid auctex emacs24 emacs24-bin-common emacs24-common sudo add-apt-repository ppa:cassou/emacs sudo apt-get update sudo apt-get install emacs24 emacs24-el emacs24-common-non-dfsg m17n-docs sudo apt-get install emacs-snapshot-el emacs-snapshot-gtk emacs-snapshot
clojure-mode
Add the following code in your “~/.emacs.d/init.el” file:
1 2 3 (require 'package ) (add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/" )) (package-initialize )
2. Open emacs24 and run the following command:
1 2 3 M-x eval-buffer M-x package-refresh-contents M-x package-install [RET ] clojure-mode [RET ]
Start NRepl in emacs
Make sure you have the following content in your “~/.emacs.d/init.el” file:
1 2 3 4 5 6 7 8 9 (require 'package ) (add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/" )) (package-initialize ) (when (not package-archive-contents) (package-refresh-contents )) (defvar my-packages '(clojure-mode nrepl)) (dolist (p my-packages) (when (not (package-installed-p p)) (package-install p)))
2. Start emacs and run the following command:
3. Create a new project with "lein new test" and open the "core.clj" file by emacs, then put your cursor at the end of the new function "foo" and do:
4. Move your focus to the REPL window and run:
5. Then you can see the result of this function call.