Skip to content

Rust binding and tools for Emacs's dynamic modules

Notifications You must be signed in to change notification settings

dwuggh/emacs-module-rs

 
 

Repository files navigation

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.

About

Rust binding and tools for Emacs's dynamic modules

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 84.5%
  • Emacs Lisp 8.5%
  • C++ 3.8%
  • PowerShell 1.4%
  • Shell 1.2%
  • JavaScript 0.5%
  • CSS 0.1%