This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Coding standards (was treelang patch)
- From: Per Bothner <per at bothner dot com>
- To: Robert Dewar <dewar at gnat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 13 May 2002 08:04:26 -0700
- Subject: Re: Coding standards (was treelang patch)
- References: <20020513125107.A913DF29F1@nile.gnat.com>
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/