diff --git a/content/cftbat/basic-emacs.html b/content/cftbat/basic-emacs.html index 4f61365c..33d20e1b 100644 --- a/content/cftbat/basic-emacs.html +++ b/content/cftbat/basic-emacs.html @@ -442,7 +442,7 @@
Next, I’ll explain how to use Emacs to efficiently develop a Clojure application. You’ll learn how to start a REPL process that’s connected to Emacs and how to work with Emacs windows. Then I’ll cover a cornucopia of useful key bindings for evaluating expressions, compiling files, and performing other handy tasks. Finally, I’ll show you how to handle Clojure errors and introduce some features of Paredit, an optional minor mode, which is useful for writing and editing code in Lisp-style languages.
If you want to start digging in to Clojure code, please do skip ahead! You can always return later.
As you learned in Chapter 1, a REPL allows you to interactively write and run Clojure code. The REPL is a running Clojure program that gives you a prompt and then reads your input, evaluates it, prints the result, and loops back to the prompt. In Chapter 1, you started the REPL in a terminal window with lein repl
. In this section, you’ll start a REPL directly in Clojure.
As you learned in Chapter 1, a REPL allows you to interactively write and run Clojure code. The REPL is a running Clojure program that gives you a prompt and then reads your input, evaluates it, prints the result, and loops back to the prompt. In Chapter 1, you started the REPL in a terminal window with lein repl
. In this section, you’ll start a REPL directly in Emacs.
To connect Emacs to a REPL, you’ll use the Emacs packageCIDER, available at https://github.com/clojure-emacs/cider/. If you followed the configuration instructions earlier in this chapter, you should already have it installed, but you can also install it by running M-x package-install, entering cider, and pressing enter.
CIDER allows you to start a REPL within Emacs and provides you with key bindings that allow you to interact with the REPL more efficiently. Go ahead and start a REPL session now. Using Emacs, open the file clojure-noob/src/clojure_noob/core.clj, which you created in Chapter 1. Next, use M-x cider-jack-in. This starts the REPL and creates a new buffer where you can interact with it. After a short wait (it should be less than a minute), you should see something like Figure 2-8.