Skip to content
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

Use SMIE for indentation #79

Merged
merged 10 commits into from Jun 14, 2019

Conversation

@j-piecuch
Copy link
Contributor

commented Jun 9, 2019

This is my attempt at providing a sensible indentation function for nix mode.
It's a bit hacky, but it works (i.e. it barely changes anything when I format something like this file.
Let me know what you think!

@etu

This comment has been minimized.

Copy link
Collaborator

commented Jun 9, 2019

Interesting! I've gotta check this out. If it passes all the tests we have so far and works reasonably well (like, changes it makes are reasonable changes, such as: The file was probably wrong) on bigger existing files are a good start.

But yeah, it needs to be tested out for a bit :)

@matthewbauer

This comment has been minimized.

Copy link
Member

commented Jun 14, 2019

Looks good mostly to me! I would like to add some more test cases, but otherwise I think it's good work! Thanks for working on this, I have been too busy to really look at nix-mode for the last few months, but I definitely think we can merge this.

I do think I want to keep nix-indent-line around and have 3 options for nix-indent-function. The main rationale for this is that we can at least in theory support more corner cases with nix-indent-line than smie-indent-line. I could be wrong on this and smie-indent-line is strictly better. Either way, keeping both seems like a safer decision.

nix-mode.el Outdated Show resolved Hide resolved
nix-mode.el Outdated Show resolved Hide resolved

@matthewbauer matthewbauer merged commit 8721f63 into NixOS:master Jun 14, 2019

1 check failed

Travis CI - Pull Request Build Failed
Details
@matthewbauer

This comment has been minimized.

Copy link
Member

commented Jun 14, 2019

Thanks! This works really well. I've release 1.4.0 with these changes and making smie-indent-line the default.

@etu

This comment has been minimized.

Copy link
Collaborator

commented Jun 15, 2019

@j-piecuch Very good job on this! :)

@nixos-discourse

This comment has been minimized.

Copy link

commented Jun 27, 2019

This pull request has been mentioned on Nix community. There might be relevant details there:

https://discourse.nixos.org/t/nixos-weekly-10-redox-on-nixos-ad-hoc-container-images-nix-mode-el-static-site-deploys-a-job/3296/1

uelei added a commit to uelei/doom-emacs that referenced this pull request Aug 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.