remove indentation configuration, smart tabs customizations#134
remove indentation configuration, smart tabs customizations#134
Conversation
1941911 to
02500dc
Compare
4c17da0 to
087eb45
Compare
rye
left a comment
There was a problem hiding this comment.
I'd re-title this PR as "Remove per-language indentation configuration, smart tabs customizations", as this PR doesn't (yet) touch the defaults specified in indentation.el to delete our changed defaults. I think we should completely remove kotct/tab-variable-setters and all of its related machinery, relying on language-specific implementations (and editorconfig-mode) to keep things as they should be. I do think the default value for indent-tabs-mode is fine, but other things will need to go to prevent clobbering.
It's worth noting to the skeptics here that editorconfig already has a lot of support for a lot of languages, and probably does a better job of keeping track of variables. Its configuration certainly was a drop-in replacement for me with Ruby code. We would still need language support files for the setup of additional tooling for each language, but no longer would indentation machinery matter.
I think it might also be smart to emit a warning if an EditorConfig is not found. The sexp (editorconfig-core-get-nearest-editorconfig default-directory) will return the filename of the nearest .editorconfig file, but I think I'd also like a warning to show up if an EditorConfig exists but does not apply to the current file. That way, we can warn the user if they're using Emacs' defaults, which I think is a scary enough thing to warrant warnings. 😄
|
After a bit of fiddling around, I've found a couple of helpful things that we could use to better support EditorConfig:
@samontea, would you mind if I mess around with this branch? |
|
Yeah feel free. Those changes sound good to me. |
Signed-off-by: Kristofer Rye <kristofer.rye@gmail.com> Tested-by: Kristofer Rye <kristofer.rye@gmail.com>
As of yet, there is no way to inhibit this behavior. Signed-off-by: Kristofer Rye <kristofer.rye@gmail.com> Tested-by: Kristofer Rye <kristofer.rye@gmail.com>
Signed-off-by: Kristofer Rye <kristofer.rye@gmail.com>
Signed-off-by: Kristofer Rye <kristofer.rye@gmail.com> Tested-by: Kristofer Rye <kristofer.rye@gmail.com>
Signed-off-by: Kristofer Rye <kristofer.rye@gmail.com>
samontea
left a comment
There was a problem hiding this comment.
your changes look good. i'd just like a little test coverage if it's trivial/doable.
rye
left a comment
There was a problem hiding this comment.
I think that if we're moving the smart tabs customizations per-language, we should also remove smart tabs support as a whole (i.e. remove it from the list of kotct dependencies and remove our logic that interacts with it). Otherwise we're effectively just hobbling smart tabs for the languages we add support for.
(I'm fine with removing the cases where we explicitly enable indent-tabs-mode and instead requiring indent-tabs-mode to be turned on by editorconfig. smart-tabs-mode should be enabled when indent-tabs-mode is.)
Signed-off-by: Kristofer Rye <kristofer.rye@gmail.com>
Signed-off-by: Kristofer Rye <kristofer.rye@gmail.com>
Signed-off-by: Kristofer Rye <kristofer.rye@gmail.com>
Signed-off-by: Kristofer Rye <kristofer.rye@gmail.com>
Signed-off-by: Kristofer Rye <kristofer.rye@gmail.com>
cg505
left a comment
There was a problem hiding this comment.
can we remove smart-tabs-mode from dependencies.el with this? if yes, should probably just do that and merge. i think everyone is on the same page here
We're currently in a funny game where we're trying to set sane defaults for languages, but also respect editorconfig configurations. However, we end up failing to respect editorconfig configurations in certain circumstances.
I think we should instead try to switch to just using editorconfig to set our indentation configurations.
If we want we can create a default .editorconfig file with sane indentation defaults and symlink it to ~/.editorconfig to give the user sane defaults for most languages.