24.2 Emacs

► |  | The Racket Guide

1 | Welcome to Racket
2 | Racket Essentials
3 | Built-In Datatypes
4 | Expressions and Definitions
5 | Programmer-Defined Datatypes
6 | Modules
7 | Contracts
8 | Input and Output
9 | Regular Expressions
10 | Exceptions and Control
11 | Iterations and Comprehensions
12 | Pattern Matching
13 | Classes and Objects
14 | Units
15 | Reflection and Dynamic Evaluation
16 | Macros
17 | Creating Languages
18 | Concurrency and Synchronization
19 | Performance
20 | Parallelism
21 | Running and Creating Executables
22 | More Libraries
23 | Dialects of Racket and Scheme
24 | Command-Line Tools and Your Editor of Choice
| Bibliography
| Index

▼ | 24 | Command-Line Tools and Your Editor of Choice

24.1 | Command-Line Tools
24.2 | Emacs
24.3 | Vim
24.4 | Sublime Text
24.5 | Visual Studio Code

► | 24.2 | Emacs

24.2.1 | Major Modes
24.2.2 | Minor Modes
24.2.3 | Packages specific to Evil Mode

On this page:

24.2.1 Major Modes
24.2.2 Minor Modes
24.2.3 Packages specific to Evil Mode

top contents ← prev up next →

### 24.2 Emacs🔗ℹ

Emacs has long been a favorite among Lispers and Schemers, and is popular among Racketeers as well.

#### 24.2.1 Major Modes🔗ℹ

- Racket mode provides thorough syntax highlighting and DrRacket-style REPL and buffer execution support for Emacs.

  Racket mode can be installed via MELPA or manually from the Github repository.

- Quack is an extension of Emacs’s scheme-mode that provides enhanced support for Racket, including highlighting and indentation of Racket-specific forms, and documentation integration.

  Quack is included in the Debian and Ubuntu repositories as part of the emacs-goodies-el package. A Gentoo port is also available (under the name app-emacs/quack).

- Geiser provides a programming environment where the editor is tightly integrated with the Racket REPL. Programmers accustomed to environments such as Slime or Squeak should feel at home using Geiser. Geiser requires GNU Emacs 23.2 or better.

  Quack and Geiser can be used together, and complement each other nicely. More information is available in the Geiser manual.

  Debian and Ubuntu packages for Geiser are available under the name geiser. A Gentoo port is also available (under the name app-emacs/geiser).

- Emacs ships with a major mode for Scheme, scheme-mode, that while not as featureful as the above options, works reasonably well for editing Racket code. However, this mode does not provide support for Racket-specific forms.

- No Racket program is complete without documentation. Scribble support for Emacs is available with Neil Van Dyke’s Scribble Mode.

  In addition, texinfo-mode (included with GNU Emacs) and plain text modes work well when editing Scribble documents. The Racket major modes above are not really suited to this task, given how different Scribble’s syntax is from Racket’s.

#### 24.2.2 Minor Modes🔗ℹ

- Paredit is a minor mode for pseudo-structurally editing programs in Lisp-like languages. In addition to providing high-level S-expression editing commands, it prevents you from accidentally unbalancing parentheses.

  Debian and Ubuntu packages for Paredit are available under the name paredit-el.

- Smartparens is a minor mode for editing s-expressions, keeping parentheses balanced, etc. Similar to Paredit.

- Symex is an intuitive modal (Vim-like) way of editing code with minimum keystrokes, built on top of a DSL providing advanced structural editing features, and runtime integration with Racket Mode.

- Alex Shinn’s scheme-complete provides intelligent, context-sensitive code completion. It also integrates with Emacs’s eldoc mode to provide live documentation in the minibuffer.

  While this mode was designed for R5RS, it can still be useful for Racket development. The tool is unaware of large portions of the Racket standard library, and there may be some discrepancies in the live documentation in cases where Scheme and Racket have diverged.

- The RainbowDelimiters mode colors parentheses and other delimiters according to their nesting depth. Coloring by nesting depth makes it easier to know, at a glance, which parentheses match.

- ParenFace lets you choose in which face (font, color, etc.) parentheses should be displayed. Choosing an alternate face makes it possible to make “tone down” parentheses.

- Mindstream lets you enter an interactive programming session (similar to DrRacket’s Definitions and Interactions workflow) at any time, starting from templates you provide. Sessions are implicitly versioned, freeing you to experiment without fear of losing work, growing organically from throwaway scratch buffers to full projects.

#### 24.2.3 Packages specific to Evil Mode🔗ℹ

- on-parens is a wrapper for smartparens motions to work better with evil-mode’s normal state.

- evil-surround provides commands to add, remove, and change parentheses and other delimiters.

- evil-textobj-anyblock adds a text-object that matches the closest of any parenthesis or other delimiter pair.

top contents ← prev up next →