justinbarclay / parinfer-rust-mode

Simplifying how you write Lisp
https://shaunlebron.github.io/parinfer/
GNU General Public License v3.0
237 stars 17 forks source link

additional toublesome modes #101

Open gilch opened 3 months ago

gilch commented 3 months ago

I notice that in my config I've got electric-indent-mode and smartparens-mode added to the parinfer-rust-troublesome-modes list.

I think we could also add to that aggressive-indent-mode, although that one might actually be useful in paren mode, it makes smart and indent modes unusable, and I think electric-indent-mode would cause similar problems but haven't tried to reproduce it lately.

smartparens-mode likes to keep brackets balanced, which makes indent and smart modes a lot less useful: instead of allowing Parinfer to infer the position of the closing bracket, it inserts the closing one immediately after typing the opening one, similar to electric-pair-mode, which is already considered troublesome.

The modes which are troublesome depend on whether Parinfer is in paren mode or not. Maybe there should be two troublesome modes lists, one for paren mode and one for indent/smart modes. They could be disabled again when you switch into that Parinfer mode and put back how they were when you switch out.

justinbarclay commented 3 months ago

Thanks for the input.

I've limited the modes I disable to those built into emacs and turned on by users. However, if users are experiencing issues with third-party packages, I am open to accepting PRs to add those packages to parinfer-rust-troublesome-modes.

I am unwilling to maintain separate lists for each of Parinfer's modes. This is primarily because I want to keep things simple to think about and maintain. However, I would support a PR that adds a hook that is called whenever parinfer-rust-mode sets the mode, which should empower others to have more precise control over when an Emacs mode is enabled or disabled.