[cmake-developers] Code style auto-formatting
Paul Smith
paul at mad-scientist.net
Mon May 9 15:29:55 EDT 2016
On Mon, 2016-05-09 at 14:17 -0400, Brad King wrote:
> > What is the rationale for "ColumnLimit: 79"? To make a line fit on old
> > school terminals, 80 should be OK. To make a diff or an email response
> > fit on old school terminals, two extra spaces are reserved. That leads
> > to a column limit of 78. Where does 79 come from?
>
> That has been CMake's limit for a long time. Since we're changing the
> style anyway we might as well go with the more common 80 chars that is
> default in the Mozilla style.
Not to say whether or not this should be changed, but FYI the 79 comes
from this set of facts:
* Traditional terminals are 80 chars wide
* Editors and viewers that do line-wrapping use the last character of
the line to specify whether there was a wrap, otherwise you can't
tell if the line is wrapped or there's a newline.
So a line that is exactly 80 characters long would look like this in
such a viewer:
this line...is 80 chars lon\
g
and this isn't
Hence the restriction to 79 chars to avoid that wrap. Also, some kind
-of-broken terminals used to automatically scroll the window if you
wrote a character to the bottom-right-most character (line 24 / char
80).
More information about the cmake-developers
mailing list