-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Emacs respect string delimiter default #6
Make Emacs respect string delimiter default #6
Conversation
Can you run I fixed up set_option to not error, but I kind of fumbled my way through a few parts just to get the errors to shut up for now. fn set_option<'a>(
options: &mut Options,
option_name: Value<'a>,
new_value: Value<'a>,
) -> Result<()> {
let env = option_name.env;
if option_name.eq(env.intern("partial-result")?) {
options.partial_result = new_value.is_not_nil();
return Ok(());
}
if option_name.eq(env.intern("force-balance")?) {
options.force_balance = new_value.is_not_nil();
return Ok(());
}
if option_name.eq(env.intern("return-parens")?) {
options.return_parens = new_value.is_not_nil();
return Ok(());
}
if option_name.eq(env.intern("comment-char")?) {
let comment_char: String = new_value.into_rust()?;
// Not sure if this is good behavior or not, to ignore the empty
// string and use the default but right now it is just one less
// error to deal with
options.comment_char = comment_char.chars().next().unwrap_or_default();
return Ok(());
}
if option_name.eq(env.intern("string-delimiters")?) {
options.string_delimiters = new_value.into_rust::<Vector>()?
.into_iter()
.map(|x| x.into_rust())
.collect::<Result<Vec<String>>>()?;
return Ok(());
}
if option_name.eq(env.intern("lisp-vline-symbols")?) {
options.lisp_vline_symbols = new_value.is_not_nil();
return Ok(());
}
if option_name.eq(env.intern("lisp-block-comments")?) {
options.lisp_block_comments = new_value.is_not_nil();
return Ok(());
}
if option_name.eq(env.intern("guile-block-comments")?) {
options.guile_block_comments = new_value.is_not_nil();
return Ok(());
}
if option_name.eq(env.intern("scheme-sexp-comments")?) {
options.scheme_sexp_comments = new_value.is_not_nil();
return Ok(());
}
if option_name.eq(env.intern("julia-long-strings")?) {
options.janet_long_strings = new_value.is_not_nil();
return Ok(());
}
// I can't get this to work, it looks like you might need to upgrade the emacs crate 17+
env.signal(unknown_option_error, option_name)
} |
On master I just added emacs to the default features in cargo so that cargo and rust-analyzer will pick them up. |
Sure I'll try again, sorry about that, I wonder how so much stuff got outdated, I suppose there’s a new version of the emacs crate |
Using the configuration `tab_spaces = 2` to minimize the impact on formatting src/emacs_wrapper.rs
This is redone by using `saturating_add_signed` instead of having an extra helper function. The function is stable since Rust 1.66
c73800a
to
adb89df
Compare
Upgrade to emacs crate 0.19 Fix all conversions to/from Lisp except the Vec<String> <-> Vector equivalence Apparently one reference to env keeps escaping
adb89df
to
180acb8
Compare
Should be fine now, ubolonton helped me with my last compilation issue |
Thanks for opening this PR :) |
Ref to original PR: eraserhd/parinfer-rust#142