This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: Coding standards (was treelang patch)


Robert Dewar wrote:
> The idea of being able to change the indent by changing the tab setting is
> a cute one, but not workable in practice. Any decent pretty printer can 
> trivially change the indentation level in any case, and furthermore, I 
> don't think it is helpful to encourage people to read the gcc sources in
> other than the standard layout.

In a previous job, I learned (was told) that develpment environments
under Windows typically store source files by using one tab for each
indent level.   Thje actual identation as it appeared on screens (and
presumably print-outs) was a user prference.

We agreed to use tabs, but add the following to the end of each source
file:

// This is for people using the Emacs editor:
// Local Variables:
// c-file-style: "java"
// tab-width: 4
// indent-tabs-mode: t
// End:

This makes Emacs handle the file by using tabs for indentation, but
displays each tab as being 4 characters wide.

There is something to be said for this convention.  However, I don't
think GNU should switch at this point, at least not without also
changing brace-indentation style.  Such a change is not worth the pain.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/


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