Skip to content

Commit 760df84

Browse files
committed
Merge pull request clojure-emacs#84 from uvtc/add-getting-started-emacs-docs
Initial commit of these "Getting Started with Emacs for Clojure" docs.
2 parents b5c16ec + 801aef2 commit 760df84

File tree

7 files changed

+185
-0
lines changed

7 files changed

+185
-0
lines changed

docs/clojure-mode.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Clojure Mode
2+
============
3+
4+
todo: copy content from technomancy/clojure-mode readme
5+
6+

docs/gnu-linux-setup.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
Emacs Setup on GNU/Linux
2+
========================
3+
4+
Emacs should be available via your OS's package manager. For example,
5+
on Debian-based distros you would typically install Emacs like so:
6+
7+
sudo apt-get install emacs
8+
9+
We recommend you install the current stable release of Emacs, version
10+
24. Since v24 was released only very recently, the above command may
11+
get you v23 instead. Use `apt-cache show emacs` to see which version
12+
it will provide.
13+
14+
15+
16+
Ubuntu-based distros
17+
--------------------
18+
19+
To get Emacs version 24 on an Ubuntu-based distribution, you currently
20+
need to do the following:
21+
22+
sudo add-apt-repository ppa:cassou/emacs
23+
sudo apt-get update
24+
sudo apt-get install emacs-snapshot
25+
26+
27+
28+
Config Files and Directory
29+
==========================
30+
31+
Your main Emacs config file is "~/.emacs". You may create
32+
this file if it does not already exist.
33+
34+
Your main Emacs config and package directory is "~/.emacs.d".
35+
Create this directory if it does not already exist.
36+
37+
38+
39+
Other Optional Configuration
40+
============================
41+
42+
A nice monospace font to use is Inconsolata. To install
43+
that on modern Debian-based distros:
44+
45+
sudo apt-get install fonts-inconsolata
46+
47+
You can then select it from within Emacs by using the "Options → Set
48+
Default Font..." menu item, and then save that setting your ~/.emacs
49+
file by using the "Options → Save Options" menu item.

docs/index.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
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).

docs/inferior-lisp.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Inferior Lisp
2+
=============
3+
4+
todo: copy content from <http://dev.clojure.org/display/doc/Getting+Started+with+Emacs>

docs/ms-windows-setup.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Emacs Setup on MS Windows
2+
=========================
3+
4+
todo

docs/os-x-setup.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Emacs Setup on OS X
2+
===================
3+
4+
todo

docs/slime-swank.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
SLIME and Swank
2+
===============
3+
4+
todo: copy content from
5+
<http://dev.clojure.org/display/doc/Getting+Started+with+Emacs>
6+
7+
Also: refer to <https://github.com/technomancy/swank-clojure> readme?

0 commit comments

Comments
 (0)