[syslinux] Thank you and patch line length

Jeffrey Hutzelman jhutz at cmu.edu
Sun Mar 1 05:55:29 PST 2009


--On Saturday, February 28, 2009 04:31:15 PM -0800 "H. Peter Anvin" 
<hpa at zytor.com> wrote:

> Gene Cumm wrote:
>>> For plaintext, typically the line break should be around 72 characters,
>>> with 79 as the absolute maximum.  It's not an exact science for me; what
>>> tends to happen is that I edit in emacs and then find myself with an
>>> overlong line, and I just hit emacs "reformat paragraph" command.
>>
>> OK, that makes sense.  I had thought I kept it under 80 but that
>> explains it.
>
> I believe you had, but I thought it looked a bit lopsided compared to
> the text aroundit.
>
>>> For code, do follow SubmittingPatches and keep the line length to < 80.
>>>  As far as indentation level, I'm not as picky as Linus; I've used both
>>> 4 and 8 spaces myself, and in some cases even just 2; I've considered
>>> doing a tree-wide reformat to either 4 or 8 spaces but haven't bothered.
>>
>> There's another question: with indentation, tabs versus spaces.  I've
>> typically been in the habit of using tab characters and letting my
>> editor assume a tab size of 8.  I notice that some of the files use
>> tabs versus others using spaces.  I'd assume just different stages of
>> when each file was started and it's a low priority to be consistent.
>>
>> I would think that it'd be better to use tabs across the board with
>> the assumption that they count as 8 characters when computing line
>> length but allows someone to view it at whatever width they like.  At
>> one point, I had decided that I liked having my tab width at 2 to take
>> up less space on my screen but this cause issues when most people
>> around me used 8 (including the console) so I switched back.
>
> That only really works, though, if you use tabs only to mark indentation
> and not, for example, to make comments line up.  As a result, I
> recommend treating tabs simply as compressed spaces with the tab width
> being 8, regardless of indentation level.

And in fact, this is what most editors do by default.  Changing the tab 
width is not the same as changing the indent level, in most editors I'm 
aware of.

At which point, you get better consistency all around if you simply avoid 
tabs altogether, and always use the correct number of spaces for the amount 
of indent you want.  IMHO the only place for tabs is in broken file formats 
that require them, such as before commands in a Makefile.

-- Jeff




More information about the Syslinux mailing list