jscheid / dtrt-indent

A minor mode that guesses the indentation offset originally used for creating source code files and transparently adjusts the corresponding settings in Emacs, making it more convenient to edit foreign files.
187 stars 31 forks source link

Add groovy-mode and yaml-mode #69

Closed terlar closed 1 year ago

terlar commented 1 year ago

Some modes rely on tab-width for their indentation, e.g. groovy-mode and yaml-mode. I think this seems like a good default or do you see any issues with this?

Edit: As suggested in your comment I updated the PR to explicitly add these two modes. I'll keep adding more if I run into others misbehaving.

rrthomas commented 1 year ago

Thanks for this PR!

I think that the modes that use tab-width should have that in their mode-specific list of variables, as otherwise tab-width will be set by default, which is certainly not desirable. (I notice that neither groovy-mode nor yaml-mode has an entry yet in dtrt-indent-hook-mapping-list etc.)

So I think the best solution in this case is to add entries for groovy-mode and yaml-mode to dtrt-indent-hook-mapping-list.

rrthomas commented 1 year ago

Thanks for this, merged!

rrthomas commented 1 year ago

I've tagged 1.10, so that should show up soon as a release.