GitXplorerGitXplorer
j

ecaml

public
254 stars
12 forks
4 issues

Commits

List of commits on branch master.
Unverified
cdd0273763e6386ea72c163bb874bb2c6190ac53

v0.18~preview.130.05+548

ppublic-release committed 2 months ago
Unverified
a8ed3e93cc00140f20819158c93cfd0a8231f8f9

v0.18~preview.130.00+55

ppublic-release committed 3 months ago
Unverified
43e9a4cc24bc29e348fc69383d0b9d9c30ada905

v0.18~preview.129.42+498

ppublic-release committed 4 months ago
Unverified
aa0346137dfe1b1251aa578320447ff5762555fc

v0.17~preview.129.36+325

ppublic-release committed 5 months ago
Unverified
eea9038a3074b508468de5ecaf6989b67540557d

v0.17~preview.129.17+77

ppublic-release committed 8 months ago
Unverified
653f231bd99eb612d98e13240b580ff4bec67bd6

v0.17~preview.129.17+77

ppublic-release committed 9 months ago

README

The README file for this repository.

Emacs packages in OCaml

Ecaml 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 example/dune.example for an example.

Using Jane Street jenga rules

Simply add (only_shared_object true) to the executables stanza in your jbuild. For instance:

(executables
 ((names (my_plugin))
  (libraries (ecaml))
  (only_shared_object true)))

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

Using other build systems

You need to use the -output-complete-obj option of ocamlopt to produce a self-contained shared object file. For instance to build the plugin in the example/ directory:

$ ocamlfind ocamlopt -linkpkg -package ecaml -thread -output-complete-obj \
    -runtime-variant _pic -pp ppx-jane example_plugin.ml -o example_plugin.so

Links

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

http://git.savannah.gnu.org/cgit/emacs.git/tree/src/emacs-module.h?id=e18ee60b02d08b2f075903005798d3d6064dc013

Here's a tutorial:

http://diobla.info/blog-archive/modules-tut.html

Here's an example plugin:

http://git.savannah.gnu.org/cgit/emacs.git/tree/modules/mod-test/mod-test.c?id=e18ee60b02d08b2f075903005798d3d6064dc013

Licensing

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.