Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ubolonton/emacs-module-rs
Rust binding and tools for Emacs's dynamic modules
https://github.com/ubolonton/emacs-module-rs
binding emacs emacs-modules ffi rust
Last synced: 2 days ago
JSON representation
Rust binding and tools for Emacs's dynamic modules
- Host: GitHub
- URL: https://github.com/ubolonton/emacs-module-rs
- Owner: ubolonton
- Created: 2017-12-22T01:26:16.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-09-19T01:52:10.000Z (3 months ago)
- Last Synced: 2024-12-12T23:07:04.003Z (9 days ago)
- Topics: binding, emacs, emacs-modules, ffi, rust
- Language: Rust
- Homepage:
- Size: 622 KB
- Stars: 342
- Watchers: 13
- Forks: 22
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Emacs Module in Rust
[![crates.io](https://img.shields.io/crates/v/emacs)](https://crates.io/crates/emacs)
[![doc.rs](https://docs.rs/emacs/badge.svg)](https://docs.rs/emacs/)
[![Azure Pipelines](https://dev.azure.com/ubolonton/emacs-module-rs/_apis/build/status/ci?branchName=master&label=build&api-version=6.0-preview.1)](https://dev.azure.com/ubolonton/emacs-module-rs/_build/latest?definitionId=1&branchName=master)
[![GitHub Actions](https://github.com/ubolonton/emacs-module-rs/actions/workflows/main.yml/badge.svg)](https://github.com/ubolonton/emacs-module-rs/actions/workflows/main.yml)[User Guide](https://ubolonton.github.io/emacs-module-rs/) | [Change Log](https://github.com/ubolonton/emacs-module-rs/blob/master/CHANGELOG.md) | [Examples](https://github.com/ubolonton/emacs-module-rs#example-modules)
This provides a high-level binding to `emacs-module`, Emacs's support for dynamic modules.
Code for a minimal module looks like this:
```rust
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> {
env.message(&format!("Hello, {}!", name))
}
``````emacs-lisp
(require 'greeting)
(greeting-say-hello "Emacs")
```## Example Modules
- [emacs-tree-sitter](https://github.com/ubolonton/emacs-tree-sitter): Binding for tree-sitter, an incremental parsing tool.
- [pullover](https://github.com/ubolonton/pullover): Use Emacs to edit text for other macOS apps.
- [test-module](test-module).
- [emacs-rs-examples](https://github.com/ubolonton/emacs-rs-examples).
- [magit-libgit2](https://github.com/ubolonton/magit-libgit2): Experimental attempt to speed up magit using libgit2.## Development
- Building:
```shell
bin/build
```
- Testing:
```shell
bin/test
```
- Continuous testing (requires `cargo-watch`):
```shell
bin/test watch
```On Windows, use PowerShell to run the corresponding `.ps1` scripts.