Skip to content

Commit b2224bc

Browse files
authored
Merge pull request #145 from austinhaas/master
Explain how to create and connect to a socket REPL in README.
2 parents 9b77479 + fcf30b5 commit b2224bc

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,40 @@ point. You can, however, change this behaviour by invoking such
103103
commands with a prefix argument. For instance: `C-u C-c C-v` will ask
104104
for the symbol you want to show the docstring for.
105105

106+
#### Starting and connecting to a socket server
107+
108+
For Leiningen, add the following option to your ~/.lein/profiles.clj or your project.clj:
109+
```
110+
:jvm-opts ["-Dclojure.server.repl={:port 5555 :accept clojure.core.server/repl}"]
111+
```
112+
113+
Then run `lein repl` from within your project directory to start the
114+
REPL, and `C-c M-c RET localhost RET 5555` from within Emacs to
115+
connect, or add the following to your `.dir-locals.el`
116+
```
117+
((nil . ((inf-clojure-lein-cmd . ("localhost" . 5555)))))
118+
```
119+
or the following to your `.emacs`
120+
```
121+
(setf inf-clojure-lein-cmd '("localhost" . 5555))
122+
```
123+
124+
For boot, export the environment variable BOOT_JVM_OPTIONS:
125+
```
126+
export BOOT_JVM_OPTIONS='-Dclojure.server.repl="{:port 5555 :accept clojure.core.server/repl}"'
127+
```
128+
or add the following to your `.dir-locals.el`:
129+
```
130+
((nil . ((inf-clojure-boot-cmd . ("localhost" . 5555)))))
131+
```
132+
or the following to your `.emacs`
133+
```
134+
(setf inf-clojure-boot-cmd '("localhost" . 5555))
135+
```
136+
137+
You can also start a socket server via the [Clojure CLI tools](https://clojure.org/guides/getting_started).
138+
Configuration options are described [here](https://dev.clojure.org/display/design/Socket+Server+REPL).
139+
106140
#### Caveats
107141

108142
Note that if you decide _NOT_ to use the socket repl, it is highly recommended

0 commit comments

Comments
 (0)