Indentation, tabs, and spaces (was re: [PATCH] support: Implement TEST_COMPARE_STRING)
Joseph Myers
joseph@codesourcery.com
Wed Nov 7 16:43:00 GMT 2018
On Wed, 7 Nov 2018, Zack Weinberg wrote:
> spaces-only indentation. I'm also constantly getting it wrong,
> especially since every other project I contribute to mandates
> spaces-only indentation so that's what my global settings are.
It should be possible to have a .dir-locals.el to specify the rules for
glibc source files. Something like
(
(nil . ((indent-tabs-mode . t)))
)
to default to tabs. To default to spaces e.g.
(
(nil . ((indent-tabs-mode . nil)))
(makefile-mode . ((indent-tabs-mode . t)))
)
(since you need to avoid space indentation in some contexts in makefiles).
(Probably there are enough different cases in glibc that more complicated
rules would be needed in practice.) Personally I'd prefer spaces-only
indentation, at least for C files (with appropriate .dir-locals.el); less
sure what we should do for .S files.
On the subject of any global formatting changes: for files that came from
external sources but are no longer merged from such sources, do people
think global reformattings into GNU style would be appropriate? (Thinking
in particular of the various files based on fdlibm, a few of which have
been reformatted at some point but most of which haven't.)
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list