Need help with ecaml?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

210 Stars 7 Forks MIT License 112 Commits 3 Opened issues


Writing Emacs plugin in OCaml

Services available


Need anything else?

Contributors list

Emacs packages in OCaml

is a library for writing Emacs packages in OCaml. It uses Emacs 25 support for dynamic modules to load native OCaml code into Emacs.

Building a plugin

Using Dune

Compile your plugin using

(modes (native shared_object))
in the executable stanza of your dune file. See
for an example.

Using Jane Street jenga rules

Simply add

(only_shared_object true)
to the
stanza in your jbuild. For instance:
 ((names (my_plugin))
  (libraries (ecaml))
  (only_shared_object true)))

Then build
with jenga. This has been tested in opam using jane-build.

Using other build systems

You need to use the

option of ocamlopt to produce a self-contained shared object file. For instance to build the plugin in the
$ ocamlfind ocamlopt -linkpkg -package ecaml -thread -output-complete-obj \
    -runtime-variant _pic -pp ppx-jane -o


As of Emacs version 25, Emacs supports plugins. Here is the API:

Here's a tutorial:

Here's an example plugin:


Note that Emacs modules must be GPL compatible, so you must make sure that your work based on Ecaml is released under a GPL compatible license.

Ecaml itself is released under the Apache 2.0 license which is GPL compatible.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.