Emacs Org-Mode Babel code block Racket support
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


An Emacs feature that defines support for Org-Mode Babel code blocks written in Racket.

Includes support for many of the usual Org SRC block header arguments (with the notable exception of session), as well as some extras for controlling the way that code blocks are evaluated. This sort of functionality is perhaps more important for Racket than for most other languages, since Racket is not just one language. Rather, Racket is an open-ended, user-extensible collection of languages (including, e.g., Racket, Scribble, Slideshow, Redex, and Magnolisp), which may not always be evaluated in the Racket VM in the usual way of just invoking the racket executable.


To use ob-racket, first ensure that Org-Mode 8 is installed, and that a major mode (such as racket-mode) has been configured for editing racket code blocks in Org.

If your mode for editing Racket code is not called racket-mode, you’ll want to specify the mode to use with something like:

(add-to-list 'org-src-lang-modes (quote ("racket" . geiser)))


Firstly, you may want to byte compile the “ob-racket.el” file, for example by invoking the byte-compile-file function under Emacs.

Then make sure the ob-racket feature is on Emacs’ load-path so that it can be loaded on demand:

(add-to-list 'load-path "/my/path/to/emacs-ob-racket")

Furthermore, you should enable racket code for evaluation (e.g., upon invoking org-babel-execute-src-block, by default bound to C-c C-c under Org), by having the org-babel-load-languages variable include racket. Something like this should do the trick:

 '((emacs-lisp . t)
   (racket . t)
   (scribble . t)))


There is no separate documentation for ob-racket, so look at the source code, and the Emacs Lisp docstrings of the functions appearing there. You will probably also find the the relevant Org documentation useful.