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

User Guide | Example

This provides a high-level binding to emacs-module. Code for a minimal module looks like this:

```rust extern crate libc;

[macro_use]

extern crate emacs;

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

emacspluginisGPLcompatible!(); emacsmoduleinit!(init);

fn init(env: &Env) -> Result { fn hello(env: &CallEnv) -> Result { let name: String = env.parse_arg(0)?; env.message(&format!("Hello, {}!", name)) }

emacs_export_functions! {
    env, "greeting-", {
        "say-hello" => (hello, 1..1)
    }
}

env.provide("greeting")

} ```

emacs-lisp (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.

Sample Modules

test-module uses most of the provided features.

Development