Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add moved notice.

  • Loading branch information...
commit b08daf866488b449a44ba8df6e5ae17a3515ef57 1 parent 0412d6e
Phil Hagelberg technomancy authored

Showing 1 changed file with 2 additions and 147 deletions. Show diff stats Hide diff stats

  1. +2 147 README.md
149 README.md
Source Rendered
... ... @@ -1,154 +1,9 @@
1 1 # Swank Clojure
2 2
  3 +**Important**: [Swank Clojure has moved!](http://github.com/technomancy/swank-clojure)
  4 +
3 5 [Swank Clojure](http://github.com/technomancy/swank-clojure) is a
4 6 server that allows [SLIME](http://common-lisp.net/project/slime/) (the
5 7 Superior Lisp Interaction Mode for Emacs) to connect to Clojure
6 8 projects. To use it you must launch a swank server, then connect to it
7 9 from within Emacs.
8   -
9   -## Usage
10   -
11   -If you just want a standalone swank server with no third-party
12   -libraries, you can just install swank-clojure using Leiningen.
13   -
14   - $ lein plugin install swank-clojure 1.3.0-SNAPSHOT
15   - $ ~/.lein/bin/swank-clojure
16   -
17   - M-x slime-connect
18   -
19   -If you put ~/.lein/bin on your $PATH it's even more convenient.
20   -
21   -You can also start a swank server from inside your project:
22   -
23   - $ lein swank [PORT=4005] [HOST=localhost]
24   -
25   -Note that the lein-swank plugin now comes with Swank Clojure; it does
26   -not need to be specified as a separate dependency any more.
27   -
28   -If you're using Maven, add this to your pom.xml under the
29   -\<dependencies\> section:
30   -
31   - <dependency>
32   - <groupId>swank-clojure</groupId>
33   - <artifactId>swank-clojure</artifactId>
34   - <version>1.2.1</version>
35   - </dependency>
36   -
37   -Then you can launch a swank server like so:
38   -
39   - $ mvn -o clojure:swank
40   -
41   -Note that due to a bug in clojure-maven-plugin, you currently cannot
42   -include it as a test-scoped dependency; it must be compile-scoped. You
43   -also cannot change the port from Maven; it's hard-coded to 4005.
44   -
45   -Put this in your Emacs configuration to get syntax highlighting in the
46   -slime repl:
47   -
48   - (add-hook 'slime-repl-mode-hook 'clojure-mode-font-lock-setup)
49   -
50   -## Connecting with SLIME
51   -
52   -Install the "slime-repl" package using package.el. If you are using
53   -Emacs 23, it's best to get [the latest version of package.el from
54   -Emacs
55   -trunk](http://bit.ly/pkg-el). Then
56   -add Technomancy as an archive source:
57   -
58   - (add-to-list 'package-archives
59   - '("technomancy" . "http://repo.technomancy.us/emacs/") t)
60   -
61   -Then you can do <kbd>M-x package-install</kbd> and choose slime-repl.
62   -
63   -When you perform the installation, you will see warnings related to
64   -the byte-compilation of the packages. This is **normal**; the packages
65   -will work just fine even if there are problems byte-compiling it upon
66   -installation.
67   -
68   -Then you should be able to connect to the swank server you launched:
69   -
70   - M-x slime-connect
71   -
72   -It will prompt you for your host (usually localhost) and port. It may
73   -also warn you that your SLIME version doesn't match your Swank
74   -version; this should be OK.
75   -
76   -Having old versions of SLIME either manually installed or installed
77   -using a system-wide package manager like apt-get may cause issues.
78   -
79   -## SLIME Commands
80   -
81   -Commonly-used SLIME commands:
82   -
83   -* **C-c TAB**: Autocomplete symbol at point
84   -* **C-x C-e**: Eval the form under the point
85   -* **C-c C-k**: Compile the current buffer
86   -* **M-.**: Jump to the definition of a var
87   -* **C-c S-i**: Inspect a value
88   -* **C-c C-m**: Macroexpand the call under the point
89   -* **C-c C-d C-d**: Look up documentation for a var
90   -* **C-c C-z**: Switch from a Clojure buffer to the repl buffer
91   -* **C-c M-p**: Switch the repl namespace to match the current buffer
92   -* **C-c C-w c**: List all callers of a given function
93   -
94   -Pressing "v" on a stack trace a debug buffer will jump to the file and
95   -line referenced by that frame if possible.
96   -
97   -Note that SLIME was designed to work with Common Lisp, which has a
98   -distinction between interpreted code and compiled code. Clojure has no
99   -such distinction, but many of the SLIME commands retain parallel
100   -load/compile commands that have the same effect in the context of
101   -Clojure.
102   -
103   -## Embedding
104   -
105   -You can embed Swank Clojure in your project, start the server from
106   -within your own code, and connect via Emacs to that instance:
107   -
108   - (ns my-app
109   - (:require [swank.swank]))
110   - (swank.swank/start-repl) ;; optionally takes a port argument
111   -
112   -Then use M-x slime-connect to connect from within Emacs.
113   -
114   -You can also start the server directly from the "java" command-line
115   -launcher if you AOT-compile it and specify "swank.swank" as your main
116   -class.
117   -
118   -## Debug Repl
119   -
120   -For now, see [Hugo Duncan's
121   -blog](http://hugoduncan.org/post/2010/swank_clojure_gets_a_break_with_the_local_environment.xhtml)
122   -for an explanation of this excellent feature. Further documentation to come.
123   -
124   -## swank-clojure.el
125   -
126   -Previous versions of Swank Clojure bundled an Elisp library called
127   -swank-clojure.el that provided ways to launch your swank server from
128   -within your Emacs process. While swank-clojure is still distributed
129   -with the project, it's a much more error-prone way of doing things
130   -than the method outlined above.
131   -
132   -If you have configured your Emacs to use M-x swank-clojure-project
133   -then it should still work, but it's not recommended for new users.
134   -
135   -## Community
136   -
137   -The [mailing list](http://groups.google.com/group/swank-clojure) and
138   -clojure channel on Freenode are the best places to bring up
139   -questions/issues.
140   -
141   -Contributions are preferred as either Github pull requests or using
142   -"git format-patch". Please use standard indentation with no tabs,
143   -trailing whitespace, or lines longer than 80 columns. See [this post
144   -on submitting good patches](http://technomancy.us/135) for some
145   -tips. If you've got some time on your hands, reading this [style
146   -guide](http://mumble.net/~campbell/scheme/style.txt) wouldn't hurt
147   -either.
148   -
149   -## License
150   -
151   -Copyright (C) 2008-2010 Jeffrey Chu, Phil Hagelberg, Hugo Duncan, and
152   -contributors
153   -
154   -Licensed under the EPL. (See the file COPYING.)

0 comments on commit b08daf8

Please sign in to comment.
Something went wrong with that request. Please try again.