Common Lisp Source Code Blocks in Org Mode

Table of Contents

Org Mode support for Common Lisp

Introduction

According to John Foderaro, Lisp is a programmable programming language.

Requirements and Setup

Common Lisp source code blocks are evaluated by Babel with the Superior Lisp Interaction Mode for Emacs, or SLIME. SLIME supports many Common Lisp implementations and is compatible with GNU Emacs version 21 and later and with XEmacs version 21.

You'll need a working installation one of the many Common Lisp implementations supported by SLIME, and SLIME itself. Consult the installation instructions for the Common Lisp implementation of your choice. SLIME installation requires just a few lines in .emacs.

To configure Common Lisp source code blocks in Org mode, add the appropriate dotted pair to org-babel-load-languages:

(org-babel-do-load-languages
 'org-babel-load-languages
 '((lisp . t)))

Org Mode Features for Common Lisp Source Code Blocks

Header Arguments

There are no language-specific default values for header arguments to Common Lisp source code blocks.

A single language-specific header argument is defined for Common Lisp source code blocks:

:package
a string that names a Common Lisp package within which to execute the source code block. The default value is :any, which will execute the source code block in the current package.

Sessions

By their nature, Common Lisp interpreters always run "sessions."

Result Types

All result types are supported.

Other

The SLIME session must be running when the Common Lisp source code block is executed.

Examples of Use

Start SLIME: M-x slime <RET>.

#+name: hello-world
#+header: :var message="Hello World!"
#+begin_src lisp
  (princ message)
#+end_src

Execute the source code block with C-c C-c to yield this result:

Hello World!

Links to Tutorials and Other Resources

Documentation from the http://orgmode.org/worg/ website (either in its HTML format or in its Org format) is licensed under the GNU Free Documentation License version 1.3 or later. The code examples and css stylesheets are licensed under the GNU General Public License v3 or later.