|
3 | 3 | `emacs-module-rs` provides high-level Rust binding and tools to write Emacs's dynamic modules. It is easy to use if you know either Rust or Emacs. |
4 | 4 |
|
5 | 5 | It currently supports: |
6 | | -- Stable Rust 1.38+. |
| 6 | +- Stable Rust 1.45+. |
7 | 7 | - Emacs 25 or above, built with module support. |
8 | 8 | - macOS, Linux, Windows. |
9 | 9 |
|
10 | | -## Known Issues |
11 | | - |
12 | | -There is a bug (see [issue #1](https://github.com/ubolonton/emacs-module-rs/issues/1)) with Emacs 26 on Linux that prevents it from loading any dynamic modules (even those written in C), if: |
13 | | -- Emacs is built without thread support. |
14 | | -- The OS is Ubuntu 16.04 (Xenial). |
15 | | - |
16 | 10 | ## Setting up |
17 | 11 |
|
18 | 12 | - Install the Rust toolchain with [rustup](https://www.rustup.rs/). |
19 | | -- Install `clang`. This is needed to generate the raw binding from `emacs-module.h`. |
20 | 13 | - Make sure that your Emacs was compiled with module support. Check that `module-file-suffix` is not `nil`, and the function `module-load` is defined. |
21 | 14 | + On macOS, the recommended installation method is MacPorts (`emacs-app` and `emacs-mac-app`). |
22 | 15 | + On Windows, the recommended installation method for older Emacs versions (before 27.2) is `pacman -S mingw-w64-x86_64-emacs` (msys2), as the archives on GNU FTP's server were built without module support. |
23 | 16 |
|
24 | | -### Windows |
25 | | -This was only tested with Rust's `msvc` toolchain, not the `gnu` toolchain. |
| 17 | +### Notes |
26 | 18 |
|
27 | | -For older versions of the crate (before 0.18.0), or when the optional feature `bindgen` is enabled, you will also need to install LLVM and set `LIBCLANG_PATH` accordingly. |
| 19 | +- On Windows, only Rust's `msvc` toolchain was confirmed to work, not the `gnu` toolchain. |
| 20 | +- When the optional feature `bindgen` is enabled, the raw binding will be generated from `emacs-module.h` at build time. Therefore you will also need to install `clang`. (This is recommended only for troubleshooting, though.) For example, on Windows: |
| 21 | + ```powershell |
| 22 | + # In Powershell |
| 23 | + scoop install llvm |
28 | 24 |
|
29 | | -```powershell |
30 | | -# In Powershell |
31 | | -scoop install llvm |
| 25 | + $env:LIBCLANG_PATH = "$(scoop prefix llvm)\bin" |
| 26 | + cargo build --all |
| 27 | + ``` |
32 | 28 |
|
33 | | -$env:LIBCLANG_PATH = "$(scoop prefix llvm)\bin" |
34 | | -cargo build --all |
| 29 | +## Known Issues |
35 | 30 |
|
36 | | -.\bin\test.ps1 |
37 | | -``` |
| 31 | +There is a bug (see [issue #1](https://github.com/ubolonton/emacs-module-rs/issues/1)) with Emacs 26 on Linux that prevents it from loading *any dynamic modules* (even those written in C), if: |
| 32 | +- Emacs is built without thread support. |
| 33 | +- The OS is Ubuntu 16.04 (Xenial). |
0 commit comments