16 releases (10 breaking)

✓ Uses Rust 2018 edition

0.11.0 Aug 5, 2019
0.10.3 Jul 24, 2019
0.9.0 Jul 11, 2019
0.6.0 Mar 26, 2019
0.1.0 May 23, 2016

#14 in FFI

Download history 7/week @ 2019-04-22 9/week @ 2019-04-29 13/week @ 2019-05-06 15/week @ 2019-05-13 38/week @ 2019-05-20 14/week @ 2019-05-27 16/week @ 2019-06-03 49/week @ 2019-06-10 32/week @ 2019-06-17 49/week @ 2019-06-24 50/week @ 2019-07-01 59/week @ 2019-07-08 39/week @ 2019-07-15 275/week @ 2019-07-22 130/week @ 2019-07-29

254 downloads per month
Used in 1 crate

BSD-3-Clause

59KB
1K SLoC

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

User Guide | Change Log | 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::plugin_is_GPL_compatible!();

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

#[defun]
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

Development

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

Dependencies

~3.5MB
~73K SLoC