This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Indentation, tabs, and spaces (was re: [PATCH] support: Implement TEST_COMPARE_STRING)
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Zack Weinberg <zackw at panix dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 7 Nov 2018 16:43:11 +0000
- Subject: Re: Indentation, tabs, and spaces (was re: [PATCH] support: Implement TEST_COMPARE_STRING)
- References: <CAKCAbMhOr2=peqhfG9rarW15nJT7zA=2AaXPOYGScCBD1aG9qw@mail.gmail.com>
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