1 #+OPTIONS: H:3 num:nil toc:2 \n:nil ::t |:t ^:{} -:t f:t *:t tex:t d:(HIDE) tags:not-in-toc
2 #+STARTUP: align fold nodlcheck hidestars oddeven lognotestate hideblocks
3 #+SEQ_TODO: TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@)
4 #+TAGS: Write(w) Update(u) Fix(f) Check(c) noexport(n)
5 #+TITLE: Common Lisp Source Code Blocks in Org Mode
6 #+AUTHOR: Thomas S. Dye
7 #+EMAIL: tsd[at]tsdye[dot]com
9 #+HTML_LINK_UP: index.html
10 #+HTML_LINK_HOME: https://orgmode.org/worg/
11 #+EXCLUDE_TAGS: noexport
15 <div id="subtitle" style="float: center; text-align: center;">
17 Org Mode support for <a href="http://common-lisp.net/project/slime/">Common Lisp</a>
20 <a href="http://common-lisp.net/project/slime/">
21 <img src="./images/slime-small.png"/>
27 * Template Checklist [12/12] :noexport:
29 - [X] Indicate #+AUTHOR:
31 - [X] Revise banner source block [3/3]
32 - [X] Add link to a useful language web site
33 - [X] Replace "Language" with language name
34 - [X] Find a suitable graphic and use it to link to the language
36 - [X] Write an [[Introduction]]
37 - [X] Describe [[Requirements and Setup][Requirements and Setup]]
38 - [X] Replace "Language" with language name in [[Org Mode Features for Language Source Code Blocks][Org Mode Features for Language Source Code Blocks]]
39 - [X] Describe [[Header Arguments][Header Arguments]]
40 - [X] Describe support for [[Sessions]]
41 - [X] Describe [[Result Types][Result Types]]
42 - [X] Describe [[Other]] differences from supported languages
43 - [X] Provide brief [[Examples of Use][Examples of Use]]
45 According to [[http://en.wikiquote.org/wiki/Lisp_programming_language][John Foderaro]], Lisp is a programmable programming language.
47 * Requirements and Setup
49 By default Common Lisp source code blocks are evaluated by Babel with
50 the Superior Lisp Interaction Mode for Emacs, or [[http://common-lisp.net/project/slime/][SLIME]]. [[http://common-lisp.net/project/slime/][SLIME]]
51 supports many Common Lisp implementations and is compatible with GNU
52 Emacs version 21 and later and with XEmacs version 21.
54 Optionally, Sylvester the Cat's Common Lisp IDE, or [[https://github.com/capitaomorte/sly][SLY]] can be used
55 for evaluation. Specify SLY by setting =org-babel-lisp-eval-fn= to
58 You'll need a working installation one of the many Common Lisp
59 implementations supported by [[http://common-lisp.net/project/slime/][SLIME]] or [[https://github.com/capitaomorte/sly][SLY]], and [[http://common-lisp.net/project/slime/][SLIME]] or [[https://github.com/capitaomorte/sly][SLY]]. Consult the
60 installation instructions for the Common Lisp implementation of your
61 choice. [[http://common-lisp.net/project/slime/doc/html/Installation.html#Installation][SLIME installation]] requires just a few lines in =.emacs=, as
62 does [[https://github.com/capitaomorte/sly][SLY]].
64 To configure Common Lisp source code blocks in Org mode, add the
65 appropriate dotted pair to =org-babel-load-languages=:
67 #+begin_src emacs-lisp :exports code
68 (org-babel-do-load-languages
69 'org-babel-load-languages
73 * Org Mode Features for Common Lisp Source Code Blocks
75 There are no language-specific default values for header arguments
76 to Common Lisp source code blocks.
78 A single language-specific header argument is defined for Common Lisp
81 - :package :: a string that names a Common Lisp package within which
82 to execute the source code block. The default value is
83 =:any=, which will execute the source code block in the
87 By their nature, Common Lisp interpreters always run "sessions."
90 All result types are supported.
93 The SLIME session must be running when the Common Lisp source code
98 Start SLIME: =M-x slime <RET>=.
102 ,#+header: :var message="Hello World!"
108 Execute the source code block with =C-c C-c= to yield this result:
110 #+header: :exports results
111 #+header: :var message="Hello World!"
116 #+results: hello-world
120 * Links to Tutorials and Other Resources
122 On-line Lisp books include an [[http://www.lisperati.com/casting.html][introductory comic book]], a [[http://www.gigamonkeys.com/book/][dead-sexy
123 introduction and tutorial]], and a [[http://paulgraham.com/onlisp.html][comprehensive study of advanced Lisp
124 techniques]]. Highly recommended.