31 个版本 (18 个重大更改)
0.19.0 | 2024 年 3 月 16 日 |
---|---|
0.18.0 | 2021 年 9 月 26 日 |
0.17.0 | 2021 年 3 月 9 日 |
0.15.0 | 2020 年 12 月 27 日 |
0.1.0 | 2016 年 5 月 23 日 |
#46 在 FFI 中
766 每月下载量
在 3 crates 中使用
100KB
2K SLoC
Rust 中的 Emacs 模块
此工具提供了对 emacs-module
的高层级绑定,这是 Emacs 对动态模块的支持。
一个最小模块的代码如下
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")
示例模块
- emacs-tree-sitter:tree-sitter 的绑定,一个增量解析工具。
- pullover:使用 Emacs 编辑其他 macOS 应用程序中的文本。
- test-module.
- emacs-rs-examples.
- magit-libgit2:使用 libgit2 加速 magit 的实验性尝试。
开发
- 构建
bin/build
- 测试
bin/test
- 持续测试(需要
cargo-watch
)bin/test watch
在 Windows 上,使用 PowerShell 运行相应的 .ps1
脚本。
依赖项
~2MB
~47K SLoC