Skip to content
Dynamic modules for emacs
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore ignore mac file Jul 11, 2017
Makefile add a bunch of builds Jul 11, 2017 Fix typo Oct 23, 2017
emacs-module-helpers.c add defconst for integers Jul 11, 2017
emacs-module-helpers.h add defconst for integers Jul 11, 2017
emacs-module.h initial commit Jul 10, 2017
gsl-constants.c initial commit Jul 10, 2017
gsl-linalg.c add examples and finish code for linalg module Jul 11, 2017
gsl-roots.c add a bunch of new modules Jul 11, 2017
mod-types.c add a bunch of new modules Jul 11, 2017
tests.el add examples and finish code for linalg module Jul 11, 2017

Dynamic modules in Emacs

This repo contains examples of creating dynamic modules for Emacs.


This repo mostly contains proofs of concept so many of these may contain only a single or small number of functions.

  • ./ has examples of using these libraries. Usually these have been blogged at some point.

The GNU Scientific library


  • ./mod-types.c shows how to test the type of an arg, and how to get a function to work for integers and floats. Also this has a little variadic function definition.
  • ./mod-list-vec.c contains some test functions for making vectors and indexing them.
  • ./emacs-module-helpers.c provides convenience functions like provide and DEFUN.

Notes to me

testing modules

It is moderately tedious to test modules because once you load them you cannot rebuild and reload them. You have to kill emacs and try again. Here is a pretty fast way to test modules. You develop in one emacs, and run the appropriate make command to build it.

Add test functions to ./tests.el. Then run them from the command line like this.

emacs -batch -q -l tests.el -f test-linalg

Or add lines like that one to the Makefile.

Resources on dynamic modules

For my own notes here are all the resources on dynamic modules I know of:

Here are the official Emacs header and example: emacs-module.h: mod_test.c:

This simple example in C

an actual ffi for emacs
elfuse a file system in Emacs
asynchronous events related to elfuse
sqlite3 binding of Emacs Lisp
JSON parser with dynamic module feature with parson
Embed Perl into Emacs
eject a cd
elisp bindings for the capstone disassembler
EmacsLisp link to Csound’s API via Emacs Modules
Emacs dynamic module for cmigemo
OpenSSL cipher binding of Emacs Lisp
Lua engine from Emacs Lisp
libzstd binding of Emacs Lisp
in Chinese, but with code

A collection of module resources:

golang writing modules in go

This may not be a dynamic module but claims an ffi haskell

You can’t perform that action at this time.