Am Wed, 12 Jun 2013 22:41:23 +0200 schrieb Uli Schlachter <psyc...@znc.in>:
> Have you read the linux kernel's coding style document? It suggests > to print out the GNU coding style and burn it as a symbolic gesture... Not yet, but will do! I assume you refer to https://www.kernel.org/doc/Documentation/CodingStyle Regarding indention: I use emacs and used the standard "indent-region". I am sure there is some nifty shortcut for compliant spacing. > Chapter 9: You've made a mess of it sorry and thanks for your extra work. > That's OK, we all do. You've probably been told by your long-time > Unix user helper that "GNU emacs" automatically formats the C sources > for you, and you've noticed that yes, it does do that, but the > defaults it uses are less than desirable (in fact, they are worse > than random typing - an infinite number of monkeys typing into GNU > emacs would never make a good program). > > So, you can either get rid of GNU emacs, or change it to use saner > values. To do the latter, you can stick the following in your .emacs > file: [...] > This will make emacs go better with the kernel coding style for C > files below ~/src/linux-trees. > > But even if you fail in getting emacs to do sane formatting, not > everything is lost: use "indent". > > Now, again, GNU indent has the same brain-dead settings that GNU emacs > has, which is why you need to give it a few command line options. > However, that's not too bad, because even the makers of GNU indent > recognize the authority of K&R (the GNU people aren't evil, they are > just severely misguided in this matter), so you just give indent the > options "-kr -i8" (stands for "K&R, 8 character indents"), or use > "scripts/Lindent", which indents in the latest style. > > "indent" has a lot of options, and especially when it comes to comment > re-formatting you may want to take a look at the man page. But > remember: "indent" is not a fix for bad programming. > I cleaned up the above stylistic nitpicks and pushed the resulting > patch. Thanks! happy to help, Kardan -- To unsubscribe, send mail to awesome-unsubscr...@naquadah.org.