31 releases (18 breaking)

0.19.0 Mar 16, 2024
0.18.0 Sep 26, 2021
0.17.0 Mar 9, 2021
0.15.0 Dec 27, 2020
0.1.0 May 23, 2016

#49 in FFI

Download history 118/week @ 2024-01-29 137/week @ 2024-02-05 140/week @ 2024-02-12 251/week @ 2024-02-19 191/week @ 2024-02-26 148/week @ 2024-03-04 384/week @ 2024-03-11 256/week @ 2024-03-18 424/week @ 2024-03-25 283/week @ 2024-04-01 240/week @ 2024-04-08 219/week @ 2024-04-15 202/week @ 2024-04-22 152/week @ 2024-04-29 152/week @ 2024-05-06 135/week @ 2024-05-13

665 downloads per month
Used in 3 crates

BSD-3-Clause

100KB
2K SLoC

Emacs Module in Rust

crates.io doc.rs Azure Pipelines GitHub Actions

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")

Example Modules

Development

  • Building:
    bin/build
    
  • Testing:
    bin/test
    
  • Continuous testing (requires cargo-watch):
    bin/test watch
    

On Windows, use PowerShell to run the corresponding .ps1 scripts.

Dependencies

~0.8–1.4MB
~31K SLoC