Skip to content

Commit 82f0481

Browse files
committed
Add section on Emacs integration
1 parent 74a7910 commit 82f0481

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

index.adoc

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ James Reeves
88
:sectnums:
99
:toc: left
1010
:url-repo: https://github.com/duct-framework/duct-framework.github.io
11+
:experimental:
1112

1213
IMPORTANT: Duct is currently in beta. This means *breaking changes* are
1314
possible but unlikely, and *bugs* are possible and likely.
@@ -221,7 +222,7 @@ Hello World
221222
:resumed
222223
----
223224

224-
You can also use the Alt-E hotkey instead of typing `(reset)`.
225+
You can also use the kbd:[Alt-E] hotkey instead of typing `(reset)`.
225226

226227
The configuration defined by `duct.edn` can be accessed with `config`,
227228
and the running system can be accessed with `system`.
@@ -1518,3 +1519,43 @@ used in this example for the sake of brevity.
15181519

15191520
Now that we have both a server and client, we can `(reset)` the REPL
15201521
and check the web application at: <http://localhost:3000>
1522+
1523+
== Development
1524+
1525+
=== Emacs
1526+
1527+
https://www.gnu.org/software/emacs/[Emacs] is a popular editor for
1528+
Clojure. https://docs.cider.mx/cider/index.html[CIDER] extends Emacs
1529+
with support for interactive programming in Clojure.
1530+
1531+
To use Emacs/CIDER with Duct, use the `--init-cider` option in your
1532+
project directory.
1533+
1534+
[,shell]
1535+
----
1536+
$ duct --init-cider
1537+
Created .dir-locals.el
1538+
----
1539+
1540+
This creates a hidden file, `.dir-locals.el`, that sets up CIDER with
1541+
Duct-specific options. To connect to the project using CIDER, open a
1542+
file in the project (such as `duct.edn`) and type:
1543+
kbd:[M-x] `clojure-jack-in` kbd:[RET]
1544+
1545+
TIP: The '`M`' in kbd:[M-x] means '`meta`' and is often bound to the
1546+
kbd:[Alt] key. '`C`' usually means kbd:[Ctrl].
1547+
1548+
Once CIDER has connected, you can open a REPL with: kbd:[C-c] kbd:[C-z]
1549+
1550+
This works in a similar way to the command-line REPL. To start up Duct,
1551+
you can use the `(go)` command:
1552+
1553+
----
1554+
user> (go)
1555+
----
1556+
1557+
To reset the project, you can use `(reset)` at the REPL, or type:
1558+
kbd:[M-x] `cider-ns-refresh` kbd:[RET]
1559+
1560+
There's also a key binding for this command:
1561+
kbd:[C-c] kbd:[M-n] kbd:[r]

0 commit comments

Comments
 (0)