► |  | 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 (Components)
15 | Reflection and Dynamic Evaluation
16 | Macros
17 | Creating Languages
18 | Performance
19 | Running and Creating Executables
20 | More Libraries
21 | Dialects of Racket and Scheme
22 | Command-Line Tools and Your Editor of Choice
| Bibliography
| Index

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

22.1 | Command-Line Tools
22.2 | Emacs
22.3 | Vim

► | 22.2 | Emacs

22.2.1 | Major Modes
22.2.2 | Minor Modes

On this page:

22.2.1`` Major Modes
22.2.2`` Minor Modes

top ← prev up next →

#### 22.2`` Emacs

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

##### 22.2.1`` Major Modes

- 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.

- Emacs ships with a major mode for Scheme, scheme-mode, that while not as featureful as the above options, but 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.

##### 22.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.

- 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. That 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.

top ← prev up next →