@@ -70,33 +70,32 @@ short of havoc.**
70
70
71
71
Just invoke ` M-x inf-clojure ` or press ` C-c C-z ` within a Clojure source file.
72
72
This will start a REPL process for the current project and you can start
73
- interacting with it. By defaul this will look for ` lein ` command on the path.
73
+ interacting with it.
74
74
75
- For configuring other repls, read below.
75
+ Inf-clojure has several custom variables which control the command used to
76
+ start a REPL for a particular project type:
76
77
77
- ` inf-clojure ` has several custom variables which control the command used to
78
- start a REPL for particular project type - ` inf-clojure-lein -cmd ` (lein),
79
- ` inf-clojure-boot-cmd ` (boot), ` inf-clojure-tools-deps-cmd ` (clj cli) and
80
- ` inf-clojure-generic-cmd ` (lumo).
78
+ - ` inf-clojure-lein-cmd ` ( [ Leiningen ] [ ] )
79
+ - ` inf-clojure-boot -cmd ` ([ Boot ] [ ] )
80
+ - ` inf-clojure-tools-deps-cmd ` ([ Clojure cli tools ] [ ] )
81
+ - ` inf-clojure-generic-cmd `
81
82
82
- The ` inf-clojure-project-type ` can force a particular project type, skipping the
83
- project detection, which can be useful for projects that don't have standard
84
- layouts.
83
+ Detection is attempted
84
+ [ in the above order] ( https://github.com/clojure-emacs/inf-clojure/blob/master/inf-clojure.el#L589-L596 )
85
+ but the ` inf-clojure-project-type ` variable can force a particular project
86
+ type, useful for projects that don't have standard layouts.
85
87
86
- By default all those variables are set to strings (e.g. ` lein repl ` ).
87
- However, it is possible to use a cons pair like ` ("localhost" . 5555) `
88
- to connect to a socket REPL like the one provided
89
- with [ planck] ( http://planck-repl.org/ ) , which can be started from the
90
- command line with ` planck -n 5555 ` .
88
+ It is highly recommended to use a cons pair like ` ("localhost" . 5555) ` to
89
+ connect to a socket REPL, terminal REPLs are inherently hard to work with and
90
+ support will be deprecated in the foreseeable future.
91
91
92
- Use ` C-u C-c C-z ` to start a REPL with a different command/cons pair than
93
- the default specified in ` inf-clojure-program ` .
92
+ Interactively, use ` M-x inf-clojure-connect ` (` C-c M-c ` ) to connect to a
93
+ running socket REPL or ` C-u C-c C-z ` for specifying a different command/cons
94
+ pair.
94
95
95
- You can use ` M-x inf-clojure-connect ` (` C-c M-c ` ) to connect to a running
96
- socket-repl. You will be prompted for host and port.
97
-
98
- You can set custom values to ` inf-clojure ` variables on a per-project basis using [ directory
99
- variables] ( https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html ) .
96
+ You can also set custom values to ` inf-clojure ` variables on a per-project
97
+ basis using
98
+ [ directory variables] ( https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html ) .
100
99
101
100
For a list of all available commands in ` inf-clojure-mode ` (a.k.a. the REPL) and
102
101
` inf-clojure-minor-mode ` you can either invoke ` C-h f RET inf-clojure-mode ` and
@@ -173,30 +172,29 @@ The socket server REPL configuration options are described [here](https://dev.cl
173
172
174
173
#### Lumo Socket REPL
175
174
176
- For lumo, setup a generic command in ` init.el ` to start the socket repl (say, port 5555)
175
+ Lumo is decoupled from ` inf-clojure-project-type ` and therefore the command used depends on what you are using for dependency resolution.
176
+
177
+ For example if a ` project.clj ` is present in the project root folder, ` inf-clojure-lein-cmd ` will be used.
178
+
179
+ After you launch ` lumo ... -n 5555 ` , as customary, either ` C-c M-c RET localhost RET 5555 ` from within Emacs or add the following to your ` .dir-locals.el ` :
177
180
178
181
``` el
179
- (setq inf-clojure-repl-use-same-window nil)
180
- (setq inf-clojure-generic-cmd '("localhost" 5555))
182
+ ((nil . ((inf-clojure-lein-cmd . ("localhost" . 5555)))))
181
183
```
182
184
183
- Then start lumo repl, like so :
185
+ or the following to your [ Emacs init file ] [ ] :
184
186
185
- ``` bash
186
- lumo -n 5555
187
+ ``` el
188
+ (setf inf-clojure-lein-cmd '("localhost" . 5555))
187
189
```
188
190
189
- If you want to use lumo with Clojure devtools
190
- [ dependencies] ( https://clojure.org/guides/deps_and_cli ) without lein or boot,
191
- add a ` deps.edn ` in the project root and run this command:
191
+ Project detection can be completely skipped and the ` generic ` project type can be used instead:
192
192
193
- ``` bash
194
- lumo -c ` clj -Spath` -n 5555
193
+ ``` el
194
+ (inf-clojure-project-type . "generic")
195
+ (setq inf-clojure-generic-cmd '("localhost" 5555))
195
196
```
196
197
197
- You can use ` M-x inf-clojure-connect ` (` C-c M-c ` ) to connect to a running
198
- socket-repl. You will be prompted for host and port.
199
-
200
198
#### Caveats
201
199
202
200
Note that if you decide _ NOT_ to use the socket repl, it is highly recommended
@@ -332,7 +330,7 @@ the classpath) in your `.dir-locals.el`:
332
330
333
331
``` el
334
332
((nil . (eval . (setq inf-clojure-generic-cmd (concat "lumo -d -c "
335
- (f-read (concat (inf-clojure-project-root) "cp")))))))
333
+ (f-read (concat (inf-clojure-project-root) "cp")))))))
336
334
```
337
335
338
336
## Troubleshooting
@@ -382,3 +380,4 @@ Distributed under the GNU General Public License; type <kbd>C-h C-c</kbd> to vie
382
380
[ melpa stable ] : http://stable.melpa.org
383
381
[ Emacs init file ] : https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html
384
382
[ Clojure cli tools ] : https://clojure.org/guides/getting_started
383
+ [ Boot ] : http://boot-clj.com
0 commit comments