10 releases (breaking)

✓ Uses Rust 2018 edition

new 0.8.0 Apr 20, 2019
0.6.0 Mar 26, 2019
0.5.2 Sep 15, 2018
0.5.1 Mar 3, 2018
0.1.0 May 23, 2016

#10 in FFI

39 downloads per month
Used in 1 crate


819 lines

Emacs Module in Rust crates.io doc.rs Build Status

User Guide | Examples

This provides a high-level binding to emacs-module, Emacs's support for dynamic modules.

Code for a minimal module looks like this:

use emacs::{defun, Env, Result, Value};


#[emacs::module(name = "greeting")]
fn init(_: &Env) -> Result<()> { Ok(()) }

fn say_hello(env: &Env, name: String) -> Result<Value<'_>> {
    env.message(&format!("Hello, {}!", name))
(require 'greeting)
(greeting-say-hello "Emacs")

Live Reloading

Emacs does not support unloading modules. Live reloading thus requires a custom module loader. rs-module is one such loader (which itself is a module that must be loaded by Emacs's normal loading mechanism). See load.sh.

Note: This doesn't work on macOS 10.13+ (High Sierra and up). See Rust's issue #28794.

Sample Modules


  • Building:
    cargo build --all
  • Testing:
  • Continuous testing (requires cargo-watch):
    cargo watch -x 'build --all' -s bin/test.sh


~64K SLoC