Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
src/ | H | 03-May-2022 | - | 1,541 | 989 | |
.cargo-checksum.json | H A D | 03-May-2022 | 89 | 1 | 1 | |
.cargo_vcs_info.json | H A D | 01-Jan-1970 | 74 | 6 | 5 | |
CHANGELOG.md | H A D | 05-Aug-2019 | 5.5 KiB | 112 | 93 | |
Cargo.toml | H A D | 01-Jan-1970 | 1.5 KiB | 48 | 40 | |
Cargo.toml.orig-cargo | H A D | 05-Aug-2019 | 1 KiB | 43 | 39 | |
README.md | H A D | 03-Aug-2019 | 2.2 KiB | 55 | 39 |
README.md
1# Emacs Module in Rust [![crates.io](https://meritbadge.herokuapp.com/emacs)](https://crates.io/crates/emacs) [![doc.rs](https://docs.rs/emacs/badge.svg)](https://docs.rs/emacs/) [![Build Status](https://travis-ci.org/ubolonton/emacs-module-rs.svg?branch=master)](https://travis-ci.org/ubolonton/emacs-module-rs) [![Build Status](https://dev.azure.com/ubolonton/emacs-module-rs/_apis/build/status/ubolonton.emacs-module-rs?branchName=master)](https://dev.azure.com/ubolonton/emacs-module-rs/_build/latest?definitionId=1&branchName=master) 2 3[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#sample-modules) 4 5This provides a high-level binding to `emacs-module`, Emacs's support for dynamic modules. 6 7Code for a minimal module looks like this: 8 9```rust 10use emacs::{defun, Env, Result, Value}; 11 12emacs::plugin_is_GPL_compatible!(); 13 14#[emacs::module(name = "greeting")] 15fn init(_: &Env) -> Result<()> { Ok(()) } 16 17#[defun] 18fn say_hello(env: &Env, name: String) -> Result<Value<'_>> { 19 env.message(&format!("Hello, {}!", name)) 20} 21``` 22 23```emacs-lisp 24(require 'greeting) 25(greeting-say-hello "Emacs") 26``` 27 28## Live Reloading 29 30Emacs does not support unloading modules. Live reloading thus requires a custom module loader. [rs-module](rs-module) is one such loader (which itself is a module that must be loaded by Emacs's normal loading mechanism). See [load.sh](bin/load.sh). 31 32**Note**: This doesn't work on macOS 10.13+ (High Sierra and up). See Rust's [issue #28794](https://github.com/rust-lang/rust/issues/28794#issuecomment-368693049). 33 34## Sample Modules 35 36- [test-module](test-module). 37- [emacs-rs-examples](https://github.com/ubolonton/emacs-rs-examples). 38- [pullover](https://github.com/ubolonton/pullover): Use Emacs to edit text for other macOS apps. 39- [magit-libgit2](https://github.com/ubolonton/magit-libgit2): Experimental attempt to speed up magit using libgit2. 40 41## Development 42 43- Building: 44 ```shell 45 cargo build --all 46 ``` 47- Testing: 48 ```shell 49 bin/test.sh 50 ``` 51- Continuous testing (requires `cargo-watch`): 52 ```shell 53 cargo watch -x 'build --all' -s bin/test.sh 54 ``` 55