Skip to content

Commit 42f860f

Browse files
arichiardibbatsov
authored andcommitted
Add Multiple Process Support section to README
1 parent 39e794c commit 42f860f

File tree

1 file changed

+41
-3
lines changed

1 file changed

+41
-3
lines changed

README.md

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,44 @@ For leiningen, there are no command line switches and you need to add a custom [
119119
...
120120
```
121121

122+
#### Multiple Process Support
123+
124+
To run multiple Clojure processes, you start the first up
125+
with `inf-clojure`. It will be in a buffer named `*inf-clojure*`.
126+
Rename this buffer with `rename-buffer`. You may now start up a new
127+
process with another `inf-clojure`. It will be in a new buffer,
128+
named `*inf-clojure*`. You can switch between the different process
129+
buffers with `switch-to-buffer`.
130+
131+
Commands that send text from source buffers to Clojure processes (like `inf-clojure-eval-defun`
132+
or `inf-clojure-show-arglists`) have to choose a process to send to, when you have more than
133+
one Clojure process around. This is determined by the global variable `inf-clojure-buffer`.
134+
135+
Suppose you have three inferior Clojures running:
136+
137+
```
138+
Buffer Process
139+
------ -------
140+
foo inf-clojure
141+
bar inf-clojure<2>
142+
*inf-clojure* inf-clojure<3>
143+
```
144+
145+
If you do a `inf-clojure-eval-defun` command on some Clojure source code,
146+
what process do you send it to?
147+
148+
- If you're in a process buffer (foo, bar, or *inf-clojure*),
149+
you send it to that process.
150+
- If you're in some other buffer (e.g., a source file), you
151+
send it to the process attached to buffer `inf-clojure-buffer`.
152+
153+
This process selection is performed by function `inf-clojure-proc`.
154+
Whenever `inf-clojure` fires up a new process, it resets
155+
`inf-clojure-buffer` to be the new process's buffer. If you only run
156+
one process, this does the right thing. If you run multiple
157+
processes, you might need to change `inf-clojure-buffer` to
158+
whichever process buffer you want to use.
159+
122160
## Configuration options
123161

124162
In the time-honoured Emacs tradition `inf-clojure`'s behaviour is extremely
@@ -127,7 +165,7 @@ configurable.
127165
You can see all the configuration options available using the command
128166
`M-x customize-group RET inf-clojure`.
129167

130-
## REPL Type
168+
#### REPL Type
131169

132170
An `inf-clojure` REPL can be of different types: Clojure,
133171
ClojureScript, Lumo and Planck are all potentially valid options. At
@@ -150,7 +188,7 @@ Lumo just add the following in your `.dir-locals.el`:
150188
((nil . ((inf-clojure-boot-cmd . "lumo -d")))) ;; inf-clojure-lein-cmd if you are using Leiningen
151189
```
152190

153-
## ElDoc
191+
#### ElDoc
154192

155193
`eldoc-mode` is supported in Clojure source buffers and `*inferior-clojure*`
156194
buffers which are running a Clojure REPL.
@@ -170,7 +208,7 @@ following to you Emacs config:
170208
ElDoc currently doesn't work with ClojureScript buffers and REPL's.
171209
You can leave it enabled, it just won't show anything in the echo area.
172210

173-
## Lumo Setup
211+
#### Lumo Setup
174212

175213
For an optimal Lumo experience the `-d` needs to be passed to Lumo
176214
when launched from the command line. This disable `readline` support

0 commit comments

Comments
 (0)