25 releases (14 breaking)

0.15.1 Jan 6, 2021
0.15.0 Dec 27, 2020
0.14.1 Oct 14, 2020
0.14.0 Apr 18, 2020
0.1.0 May 23, 2016

#29 in FFI

Download history 42/week @ 2020-09-28 33/week @ 2020-10-05 125/week @ 2020-10-12 106/week @ 2020-10-19 58/week @ 2020-10-26 194/week @ 2020-11-02 22/week @ 2020-11-09 39/week @ 2020-11-16 68/week @ 2020-11-23 55/week @ 2020-11-30 147/week @ 2020-12-07 150/week @ 2020-12-14 131/week @ 2020-12-21 71/week @ 2020-12-28 134/week @ 2021-01-04 79/week @ 2021-01-11

422 downloads per month
Used in emacs-rs-module

BSD-3-Clause

78KB
1.5K SLoC

Emacs Module in Rust

crates.io doc.rs 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")

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

~1–3MB
~67K SLoC