|
| 1 | +Getting Started With Emacs |
| 2 | +========================== |
| 3 | + |
| 4 | +[GNU Emacs](http://www.gnu.org/software/emacs/emacs.html) provides |
| 5 | +excellent support for Clojure programming and is widely used within |
| 6 | +the Clojure community. |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +Installation |
| 12 | +============ |
| 13 | + |
| 14 | +For installing Emacs and generally finding your way around Emacs on |
| 15 | +your platform, proceed now to one of the platform-specific docs: |
| 16 | + |
| 17 | + * [GNU/Linux setup](gnu-linux-setup.md) |
| 18 | + * [Mac OS X setup](os-x-setup.md) |
| 19 | + * [MS Windows setup](ms-windows-setup.md) |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | +Configuration Overview |
| 24 | +====================== |
| 25 | + |
| 26 | +Once you've got Emacs installed, typical configuration for use |
| 27 | +with Clojure includes: |
| 28 | + |
| 29 | + * enabling the use of a remote Emacs package repository |
| 30 | + * installing clojure-mode (provides support for syntax highlighting |
| 31 | + and proper indentation for Clojure files (.clj files)) |
| 32 | + * optionally enabling paredit mode (advanced support for working with |
| 33 | + expressions in parentheses/brackets) |
| 34 | + |
| 35 | +and then deciding if you want to use an interactive interface to the |
| 36 | +Clojure repl from inside of Emacs. If you want this, the two routes to |
| 37 | +choose from are: |
| 38 | + |
| 39 | + * use the "inferior-lisp" mode, or |
| 40 | + * use SLIME and Swank |
| 41 | + |
| 42 | +See below for discussion on each of these options. |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | +Package Repository |
| 47 | +------------------ |
| 48 | + |
| 49 | +Emacs packages extend the editor in various ways, and (as of version |
| 50 | +24) Emacs can install them from a remote repository. All the packages |
| 51 | +we'll need here can be found in the [Melpa](http://melpa.milkbox.net/) |
| 52 | +repository. Tell Emacs about melpa by adding the following to your |
| 53 | +~/.emacs file: |
| 54 | + |
| 55 | +~~~{.scheme} |
| 56 | +(require 'package) |
| 57 | +(add-to-list 'package-archives |
| 58 | + '("melpa" . "http://melpa.milkbox.net/packages/") t) |
| 59 | +(package-initialize) |
| 60 | +~~~ |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | +Clojure Mode |
| 65 | +------------ |
| 66 | + |
| 67 | +Emacs uses so-called "major modes" (as in, "mode of operation") to |
| 68 | +provide filetype-specific editor support. For example, you edit a Java |
| 69 | +file using the Emacs java mode, and Clojure using a clojure |
| 70 | +mode. Emacs doesn't yet come with a Clojure mode by default, so we |
| 71 | +must install it. |
| 72 | + |
| 73 | +Install clojure-mode while running Emacs. Hit "M-x package-install RET |
| 74 | +clojure-mode". After doing this, Emacs should automatically recognize |
| 75 | +.clj files as Clojure files when you open them. |
| 76 | + |
| 77 | +See [clojure mode](clojure-mode.md) for more info on using it. |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | +Paredit Mode |
| 83 | +------------ |
| 84 | + |
| 85 | +todo |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | +REPL Interaction |
| 91 | +================ |
| 92 | + |
| 93 | +If you like, you can simply interact with the Clojure repl that |
| 94 | +[Leiningen](http://leiningen.org/index.html) provides for you (via |
| 95 | +`lein repl`) --- totally separate from Emacs. However, Emacs can |
| 96 | +provide access to the repl from within an Emacs buffer if you prefer: |
| 97 | + |
| 98 | + * The simplest way to interact with the repl from within Emacs is to |
| 99 | + [use inferior-mode](inferior-mode.md). |
| 100 | + |
| 101 | + * For more functionality, [use slime & swank](slime-swank.md). |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | +Detailed Emacs Documentation |
| 107 | +============================ |
| 108 | + |
| 109 | +GNU Emacs provides excellent built-in documention which is available |
| 110 | +within the editor (see "C-h") and also |
| 111 | +[online](http://www.gnu.org/software/emacs/manual/html_node/emacs/index.html). |
0 commit comments