Skip to content


Subversion checkout URL

You can clone with
Download ZIP
org-babel support for Standard ML
Emacs Lisp
branch: master

Merge pull request #5 from spacemanaki/master

Strip '-' printed by SML/NJ when evaling code blocks with leading empty lines
latest commit 958165c92b
@swannodette authored
Failed to load latest commit information. tweak
ob-sml.el Merge pull request #5 from spacemanaki/master


Put ob-sml.el where it can be loaded by Emacs. For example I place it in a directory ~/.emacs.d/vendor which is automatically put on the load path with the following:

(let ((default-directory  "~/.emacs.d/vendor/"))

Then require it and make sure org-babel knows about it like so:

(require 'ob-sml nil 'noerror)

 '((clojure . t)
   (ruby . t)
   (scheme . t)
   (js . t)
   (haskell . t)
   (prolog . t)
   (sml . t) ;; added!

To test, create a new org-mode file such as Then add the following to this file:

ML for the Working Programmer

* Chapter 1
#+BEGIN_SRC sml :session *sml*
  fn n => n + 1

Start a sml REPL with M-x run-sml. You should now be able to place your cursor in the code block and evaluate with C-c C-c and the contents of your file should now look like:

* Chapter 1
#+BEGIN_SRC sml :session *sml*
  fn n => n + 1

: val it = fn : int -> int
Something went wrong with that request. Please try again.