Skip to content

rickmode/clojure-mode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clojure Mode

Provides Emacs font-lock, indentation, and navigation for the Clojure language.

Installation

It's easiest to install and keep Clojure Mode updated using package.el.

;; add to ~/.emacs.d/init.el if you aren't already using Marmalade.
(require 'package)
(add-to-list 'package-archives
             '("marmalade" . "http://marmalade-repo.org/packages/"))
(package-initialize)
  • M-x eval-buffer
  • M-x package-refresh-contents
  • M-x package-install clojure-mode

If you use a version of Emacs prior to 24 that doesn't include package.el, you can get it from http://bit.ly/pkg-el23. If you have an older package.el installed from tromey.com, you should upgrade in order to support installation from multiple sources.

Of course, it's possible to install from source if you don't mind missing out on automated updates, byte-compilation, and autoloads. Download clojure-mode.el and place it in the ~/.emacs.d/ directory, creating it if it doesn't exist. Then add this to the file ~/.emacs.d/init.el:

(add-to-list 'load-path "~/.emacs.d/")
(require 'clojure-mode)

Paredit

Using clojure-mode with paredit is highly recommended. It is also available using package.el from the above archive.

Use paredit as you normally would with any other mode; for instance:

;; (require 'paredit) if you didn't install via package.el
(defun turn-on-paredit () (paredit-mode 1))
(add-hook 'clojure-mode-hook 'turn-on-paredit)

Basic REPL

Use M-x run-lisp to open a simple REPL subprocess using Leiningen. Once that has opened, you can use C-c C-r to evaluate the region or C-c C-l to load the whole file.

If you don't use Leiningen, you can set inferior-lisp-program to a different REPL command.

SLIME

You can also use Leiningen to start an enhanced REPL via SLIME:

$ lein plugin install swank-clojure 1.3.3

M-x clojure-jack-in # from inside a project

License

Copyright © 2007-2011 Jeffrey Chu, Lennart Staflin, Phil Hagelberg

Distributed under the GNU General Public License; see C-h t to view.

About

Emacs support for the Clojure language

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Emacs Lisp 98.9%
  • Clojure 1.1%