@@ -70,33 +70,32 @@ short of havoc.**
7070
7171Just invoke ` M-x inf-clojure ` or press ` C-c C-z ` within a Clojure source file.
7272This 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.
7474
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:
7677
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 `
8182
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.
8587
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.
9191
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.
9495
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 ) .
10099
101100For a list of all available commands in ` inf-clojure-mode ` (a.k.a. the REPL) and
102101` 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
173172
174173#### Lumo Socket REPL
175174
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 ` :
177180
178181``` 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)))))
181183```
182184
183- Then start lumo repl, like so :
185+ or the following to your [ Emacs init file ] [ ] :
184186
185- ``` bash
186- lumo -n 5555
187+ ``` el
188+ (setf inf-clojure-lein-cmd '("localhost" . 5555))
187189```
188190
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:
192192
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))
195196```
196197
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-
200198#### Caveats
201199
202200Note 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`:
332330
333331``` el
334332((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")))))))
336334```
337335
338336## Troubleshooting
@@ -382,3 +380,4 @@ Distributed under the GNU General Public License; type <kbd>C-h C-c</kbd> to vie
382380[ melpa stable ] : http://stable.melpa.org
383381[ Emacs init file ] : https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html
384382[ Clojure cli tools ] : https://clojure.org/guides/getting_started
383+ [ Boot ] : http://boot-clj.com
0 commit comments