Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 07 Apr 2015 18:11:04 +0200
From: magnum <john.magnum@...hmail.com>
To: john-dev@...ts.openwall.com
Subject: Re: Coding Style

On 2015-04-07 10:01, magnum wrote:
> Also, I think we should document that we use "tab for indent, space for
> align" as in http://emacswiki.org/emacs/SmartTabs. This is actually what
> you get with Solar's recommended indent(1) options so I presume his
> recent disagreement was just a misunderstanding.

I recalled incorrectly (I have done all formatting with emacs' SmartTabs
for years). GNU indent can NOT be taught to align with spaces and our so
far recommended settings turns off alignment :-/

The -nlp turns off alignment to parens on continuation lines. And
without it, multiple tabs are used for the alignment (whoa, BAD idea)
and there doesn't seem to be any way enforcing "space to align". So if
we are to use indent at all, we have to use -nlp and give up alignment.

However, astyle (http://astyle.sourceforge.net/) seem to be a much
better fit (btw radare seem to use it). This comes very close to what I
want, including the format structs:

astyle --style=kr -t4 -U -H -p -xC79 -c -k3 -z2 -y <file>

Of these, I consider -y (aka. --break-closing-brackets, eg. put an
'else' below the preceeding closing bracket instead of after it) less
important.

magnum

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ