ubolonton/emacs-module-rs

Rust binding and tools for Emacs's dynamic modules

Rust

373

574 commits

updated Sep 24, 2026

See the code

README

Emacs Module in Rust

crates.io doc.rs 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:
    cargo xtask build
    
  • Testing:
    cargo xtask test
    
  • Continuous testing (requires cargo-watch):
    cargo xtask test --watch
    
binding
emacs
emacs-modules
ffi
rust

Contributors

ubolonton

515 commits

jjpe

45 commits

AeroNotix

6 commits

ezemtsov

3 commits

Languages

Rust

72.2%

C++

10.2%

Shell

7.1%

Emacs Lisp

6.4%

PowerShell

3.6%

ubolonton/emacs-module-rs

Rust binding and tools for Emacs's dynamic modules

Rust

373

574 commits

updated Sep 24, 2026

See the code

README

Emacs Module in Rust

crates.io doc.rs 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:
    cargo xtask build
    
  • Testing:
    cargo xtask test
    
  • Continuous testing (requires cargo-watch):
    cargo xtask test --watch
    
binding
emacs
emacs-modules
ffi
rust

Contributors

ubolonton

515 commits

jjpe

45 commits

AeroNotix

6 commits

ezemtsov

3 commits

Languages

Rust

72.2%

C++

10.2%

Shell

7.1%

Emacs Lisp

6.4%

PowerShell

3.6%