|
This is a funny one. In emacs' editorconfig.el, you can see the
following comment: "When users choose `indent_size=tab`, they most
likely prefer `indent_style=tab` as well.
Ths directly follows a workaround an issue of excessively setting
tab-width even when it's not explicitly requested.
This means that the behavior of editorconfig.el is as follows:
* If tab_width is set, the value is used.
* Else, if indent_style is set to "tab", indent_size is used for
tab_width.
What I would like is to keep my tab_width and (non-existent)
space_width in sync, and then have (by default) the default
per-filetype indentation style, with the ability to override
them.
This means unsetting indent_style (as it was before), and then setting
indent_size to the common width, which is the editorconfig preferred
approach. Because of the abovementioned bug workaround, since
indent_style is unset (i.e. is not "tab"), indent_size is not used for
tab_width.
Up until now, the way I've been working around this is by setting
indent_size to tab and then using tab_width to control the de-facto
indent_size (reversing the logic). This has the additional bonus of
being more explicit, and keeping mixed tab/space indentations
internally consistent. The problem then is that the indent_size=tab is
treated as a hint to set indent_style=tab globally, removing my
ability to use the filetype default.
I can either patch the code in question, or I can just accept that my
global preference (as a default, other things not considered) is for
spaces (though I do appreciate tabs in specific circumstances). This
line applies this : spaces are now a global default, and I can set a
tab style where appropriate, including in projects.
|