Open-source project
greghendershott/racket-mode avatar
greghendershott/racket-mode

racket-mode gives Emacs a DrRacket-like Racket workflow

Emacs major and minor modes for Racket: edit, REPL, check-syntax, debug, profile, packages, and more.

723 stars91 forksEmacs LispGPL-3.0

At a glance

What is it?
racket-mode is a set of Emacs major and minor modes for Racket covering editing, the REPL, syntax checking, debugging, profiling, logging and packages, with the edit and run experience described as similar to DrRacket. It is GPL-3.0 licensed and needs Emacs 25.1 or later and Racket 7.8 or later.
Who is it for?
racket-mode suits an Emacs user who wants to write Racket without leaving the editor, since the REPL, syntax checking, debugger, profiler and package tooling are all driven from inside Emacs rather than from a separate IDE.
Can I use it commercially?
Yes, with conditions. GPL-3.0 is a copyleft licence: if you distribute software that includes it, you must release that software's source code under the same licence. Running it internally without distributing it does not trigger that obligation.
Is it still maintained?
Yes. The repository last received commits 23 days ago.
What is it written in?
Mainly Emacs Lisp, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What the modes cover

racket-mode is a variety of Emacs major and minor modes for Racket, and the README lists the areas it covers as edit, REPL, check-syntax, debug, profile, logging, and more.

That list maps onto a real workflow rather than a single component. The major mode handles the editing surface, the minor modes add the interactive parts, and the repository layout shows the granularity: there are separate files for the REPL, the debugger, the profiler, the logger, the package manager, the back end, browse URL, bug report, collection, completion, customisation, describe, doc, font lock, hash language, imenu, indentation, input, keywords and builtins, the lisp mode, the parens handling, the ppss, the repl buffer name, scribble, shell, smart open, the stepper, utilities, visit, WSL, and the XP style completion.

The point of that granularity is worth naming. A single file for all of it would be unmaintainable, and the split means a feature can be loaded or overridden independently. racket-lisp-mode.el and racket-xp.el sit alongside racket-mode.el because Racket has several surface syntaxes, and a mode that only handled one of them would be of limited use.

The README also states the compatibility range, which is worth checking before anything else: compatible with Emacs 25.1+ and Racket 7.8+. The project is written in Emacs Lisp, and the topics list names drracket, emacs, gnu-emacs and racket.

Where to install it from

The README does not contain a copy and paste install command, and that is deliberate for a project that is distributed as an Emacs package rather than as a program.

The distribution channels are named in the badges at the top of the README. There is a MELPA badge pointing at melpa.org/#/racket-mode, and an ELPA badge pointing at elpa.nongnu.org/nongnu/racket-mode.html. MELPA is the community package archive for Emacs, and the non-GNU ELPA is the package archive for packages that are not part of GNU Emacs itself, which is where this one lives. The two badges tell you the package is available from either, and the choice between them is a matter of which archives you have configured.

The documentation is at www.racket-mode.com, described in the README as a Guide and Reference, and the badge is labelled Docs and Documentation.

For contributors, the README points at CONTRIBUTING.org for guidance, and THANKS.org for acknowledgments. The repository root has a Makefile and a .dir-locals.el, plus a .elpaignore file, which is the standard way of excluding files from a package build, and a racket/ directory that appears to hold Racket-side support files alongside the test/ directory.

There are no GitHub releases for the project, so the package repositories are the distribution mechanism and the git repository is where the development happens.

The Makefile and how the modes are tested

The Makefile is where the development workflow shows, and it is more informative than a contribution guide would be on its own.

Two variables at the top control which executables are used, and the comment explains why:

make
EMACS ?= emacs
RACKET ?= racket

The comment above them says to allow running with an emacs or racket executable other than the default on PATH, giving the example EMACS=/path/to/emacs make. That matters on a machine with several Emacs installations, or with a Racket that is not the one on the PATH.

The test target is the interesting part. The declared targets include show-versions, clean, compile, deps, test, test-elisp, test-racket, test-racket-submod, test-racket-plain and test-racket-slow, and the test target is defined as test: test-racket test-elisp, so the full suite runs both the Racket side and the Emacs Lisp side.

The Emacs side is run in batch mode, without loading the user's configuration, and byte-compiles every .el file in the top directory:

make
batch-emacs := \
  $(EMACS) --batch -Q -L . \
  --eval '(require (quote package))' \
  --eval '(package-initialize)'

The -Q flag is the important detail, because it means the user's init file is not loaded and the tests cannot pass or fail depending on what somebody has installed in their own configuration. The byte-compile step sets byte-compile-error-on-warn to t, so a warning during compilation fails the build rather than scrolling past, and the separate check-declares target validates the declare forms in the package with check-declare.

The deps target installs the Emacs packages the project depends on for development and testing, and the comment is careful to explain the division: normal users get a subset of these dependencies automatically as a result of the Package-Requires in racket-mode.el.

Checking your setup before you start

The show-versions target exists for a reason, and it is the first thing to run when something does not work.

make
show-versions:
	@echo `which $(RACKET)`
	@$(RACKET) --version
	@echo `which $(EMACS)`
	@$(EMACS) --version

It prints the path and the version of both Racket and Emacs. Since the project states Emacs 25.1+ and Racket 7.8+ as the requirements, this is the quickest way to confirm you are above both floors before you blame something else.

The Racket test targets are split by speed, which reflects a real cost difference: test-racket-plain, test-racket-submod and test-racket-slow are separate from the main test-racket run. Running Racket tests in a mode that exercises module loading and slower paths takes noticeably longer, so separating them lets a contributor run the fast subset during development and the slow one before release.

That split is a small thing, but it is the kind of detail that indicates the project has a working CI. The README carries a GitHub Actions badge for the repository's workflows, so the same split is what runs there.

The alternative the README names

The README has an Alternatives section, and it names Emacs' built-in major mode scheme-mode plus the minor modes Quack and/or Geiser.

That is a real alternative and not a token mention, because the reason is structural. scheme-mode is in Emacs itself, so it needs no installation and is maintained with Emacs. Quack and Geiser are third-party minor modes that add Racket support on top of it, and Geiser in particular is a well known choice for Scheme and Racket work in Emacs.

The difference in approach is worth being concrete about. racket-mode is a purpose built set of modes for Racket, and it can therefore offer Racket specific things: the REPL integration, check-syntax against the Racket toolchain, the debugger, the profiler, the logger, the package manager integration, Racket's scribble document support, and the XP completion style, which Racket inherits from its Scheme lineage and which needs a different indentation engine from a plain Lisp mode.

The scheme-mode route, by contrast, is generic. You get a mode for Scheme that happens to work reasonably on Racket source, and you add a completion package. That is the right choice if you move between Scheme and Racket, or if you want a minimal setup with one well known package instead of a large mode. It is the wrong choice if you work in Racket full time, because the Racket specific tooling is the reason you would want a dedicated mode.

One limitation is worth naming. The README describes the edit and run experience as similar to DrRacket, and similar is the operative word. DrRacket itself is a full IDE with a graphical debugger, a visualizer and a teaching support for beginner languages, and racket-mode is an Emacs mode set, so the debugging and profiling features here are terminal based and will not match the graphical tooling.

Editorial conclusion

racket-mode suits an Emacs user who wants to write Racket without leaving the editor, since the REPL, syntax checking, debugger, profiler and package tooling are all driven from inside Emacs rather than from a separate IDE. It is the wrong tool if you want the full DrRacket experience, because the README describes the edit and run experience as similar to DrRacket rather than equal to it, and it is the wrong tool if you are on a very old Emacs or Racket, since the stated floors are Emacs 25.1 and Racket 7.8. Before installing, read the Guide and Reference at racket-mode.com, and check which of the two package repositories suits you, MELPA or the non-GNU ELPA, since they carry the package differently.

Frequently asked questions

How do I install racket-mode in Emacs?

The package is available from MELPA and from the non-GNU ELPA, and the README points to the Guide and Reference at www.racket-mode.com for details. The README itself does not give a command to run, so the package archive configuration in your Emacs setup is where the installation happens.

What does racket-mode include?

A variety of Emacs major and minor modes for Racket, covering edit, REPL, check-syntax, debug, profile, logging and more, with the edit and run experience described as similar to DrRacket. The repository splits the functionality across many files, including racket-repl.el, racket-debug.el, racket-profile.el, racket-package.el and racket-xp.el.

What are the version requirements for racket-mode?

The README states compatibility with Emacs 25.1+ and Racket 7.8+. The Makefile has a show-versions target that prints the path and version of both executables, which is the quickest way to confirm you meet both floors.

How do I run the racket-mode test suite?

Run make test, which is defined as test: test-racket test-elisp, so it runs both the Racket side and the Emacs Lisp side. The Racket tests are further split into test-racket-plain, test-racket-submod and test-racket-slow variants, and the Emacs side is byte-compiled in batch mode with byte-compile-error-on-warn set so warnings fail the build.

What is the alternative to racket-mode?

The README names Emacs' built-in scheme-mode plus the minor modes Quack and/or Geiser. That route needs no Racket specific major mode and works well if you also write Scheme, at the cost of the Racket specific tooling such as the REPL integration, check-syntax, the debugger, the profiler and the package manager support.

Official sources

  1. greghendershott/racket-mode on GitHub
  2. Issues
  3. License: GPL-3.0
  4. Project website
  5. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/greghendershott-racket-mode.svg)](https://hysenlabs.com/projects/greghendershott-racket-mode)

Was this useful?