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

#54 in FFI

Download history 172/week @ 2024-07-24 169/week @ 2024-07-31 188/week @ 2024-08-07 200/week @ 2024-08-14 185/week @ 2024-08-21 497/week @ 2024-08-28 336/week @ 2024-09-04 253/week @ 2024-09-11 288/week @ 2024-09-18 330/week @ 2024-09-25 487/week @ 2024-10-02 264/week @ 2024-10-09 233/week @ 2024-10-16 228/week @ 2024-10-23 211/week @ 2024-10-30 142/week @ 2024-11-06

850 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

~2MB
~50K SLoC