This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Indentation, tabs, and spaces (was re: [PATCH] support: Implement TEST_COMPARE_STRING)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]