3 ms·
There's the good old GNU indent https://www.gnu.org/software/indent/ https://www.gnu.org/software/indent/ > But even if you fail in getting emacs to do sane fo
by ciupicri 1y ago
There's the good old GNU indent https://www.gnu.org/software/indent/ https://www.gnu.org/software/indent/
> 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.
(Linux kernel coding style, https://www.kernel.org/doc/html/latest/process/coding-style.html#you-ve-made-a-mess-of-it https://www.kernel.org/doc/html/latest/process/coding-style....)