Org-Babel support for evaluating erlang source code.
Clone repository and put ob-erlang.el
in your Emacs load path.
git clone https://github.com/xfwduke/ob-erlang
Add ob-erlang.el
to your load path. Example:
(add-to-list 'load-path "~/.emacs.d/site-packages")
Then copy file ob-erlang.el
to ~/.emacs.d/site-packages
(require 'ob-erlang)
(org-babel-do-load-languages
'org-babel-load-languages
'((erlang . t)))
-compile(export_all).
will be auto inserted into code during compile phase if no -export([]).
line in the code.
Specify module name for erlang code.
It will be omitted if the code contained -module(ModuleName).
#+BEGIN_SRC erlang :module tryerlang
start() ->
io:format("hello world").
#+END_SRC
#+RESULTS:
: hello world
If no module name is specified by any of the above means, then a
default module name of m
is used.
Specify entry function to eval erlang code. Erlang's default entry function is start/0.
#+BEGIN_SRC erlang :module notstart :start main
main() ->
io:format("entry is main/0").
#+END_SRC
#+RESULTS:
: entry is main/0
#+BEGIN_SRC erlang
-module(sayhello).
start() ->
io:format("say hello").
#+END_SRC
#+RESULTS:
: say hello
Specify erlang node long-name
Specify cookie for -setcookie