Skip to content

Commit

Permalink
Merge pull request #103 from ranfdev/emacs-optional
Browse files Browse the repository at this point in the history
Make emacs dependency optional
  • Loading branch information
eraserhd authored Jul 23, 2021
2 parents afcacc8 + 284e3b8 commit a94c45a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ https://github.com/eraserhd/parinfer-rust/compare/v0.4.3...HEAD[Unreleased]
- `#;(S-expression comments)`
* Support for Guile's `#!block comments!#`

=== Emacs

* Compilation for Emacs is now optional. To enable it, run
`cargo build --release --features emacs`


https://github.com/eraserhd/parinfer-rust/compare/v0.4.2...v0.4.3[0.4.3]
------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ path = "src/main.rs"
[dependencies]
getopts = "0.2"
libc = "0.2.39"
emacs = "0.16.2"
serde = "1.0"
emacs = {version = "0.16.2", optional = true}
serde_json = "1.0"
serde_derive = "1.0"
unicode-segmentation = "1.1.0"
Expand Down
6 changes: 6 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Dependencies:
* https://www.rust-lang.org/en-US/install.html[rust] >= 1.36
* `clang` and `libclang-dev` packages or equivalent for your OS


=== Stand-alone CLI

If you just want to run `parinfer-rust` from the command-line:
Expand All @@ -27,6 +28,11 @@ $ cargo build --release
$ cargo install
....

If you use emacs add the corresponding feature flag during compilation
....
$ cargo build --release --features emacs
....

=== Vim and Neovim

==== `+pathogen+`
Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ mod types;
mod changes;

#[macro_use]
#[cfg(feature = "emacs")]
extern crate emacs;
// Native-specific stuff

Expand All @@ -28,9 +29,11 @@ pub use c_wrapper::run_parinfer;
pub use c_wrapper::INITIALIZED;

#[cfg(not(target_arch = "wasm32"))]
#[cfg(feature = "emacs")]
mod emacs_wrapper;

#[cfg(not(target_arch = "wasm32"))]
#[cfg(feature = "emacs")]
pub use emacs_wrapper::init;

// WebAssembly-specific stuff
Expand Down

0 comments on commit a94c45a

Please sign in to comment.