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

#67 in FFI

Download history 372/week @ 2024-10-04 251/week @ 2024-10-11 260/week @ 2024-10-18 174/week @ 2024-10-25 211/week @ 2024-11-01 156/week @ 2024-11-08 187/week @ 2024-11-15 211/week @ 2024-11-22 197/week @ 2024-11-29 321/week @ 2024-12-06 181/week @ 2024-12-13 135/week @ 2024-12-20 94/week @ 2024-12-27 155/week @ 2025-01-03 250/week @ 2025-01-10 153/week @ 2025-01-17

662 downloads per month
Used in 4 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.7–1.4MB
~28K SLoC