This provides a high-level binding to emacs-module, Emacs's support for dynamic modules.
Code for a minimal module looks like this:
use rem::{defun, Env, Result, Value};
rem::plugin_is_GPL_compatible!();
#[rem::module(name = "greeting")]
fn init(env: &Env) -> Result<()> {
env.lambda(&SayHello, None)?.fset("greeting-say-hello")?;
Ok(())
}
#[defun]
fn say_hello(env: &Env, name: String) -> Result<Value<'_>> {
env.message(&format!("Hello, {}!", name))
}(require 'greeting)
(greeting-say-hello "Emacs")cargo checkcargo test --workspace