0

With gnu-indent how to change

int i = fact(n);

to

int i = fact (n);

-gnu formats it so but I use -kr.

Necktwi
  • 2,483
  • 7
  • 39
  • 62
  • 5
    Why would you want that?! – DeiDei Dec 05 '18 at 15:17
  • 1
    just to minimize the patch and also I like. English got the space between word and braces. – Necktwi Dec 05 '18 at 15:32
  • 2
    *Why* is actually important here. There's nothing inherently wrong with such code formatting, but be aware that code comprehension by persons not familiar with your code depends on the viewer's brain deciphering patterns - human brains don't see details well, they see patterns, and they see and understand familiar patterns better. Using a rare formatting style will make your code a bit less easy to understand for others, and will also make it a bit harder for you to understand formats you don't use often as you're not as familiar with the pattern. – Andrew Henle Dec 05 '18 at 15:32
  • Well, the language is called "C", not "English". ;) Applying rules of a natural language to some artificial language just feels so ... wrong. – Gerhardh Dec 05 '18 at 15:54
  • 2
    Only one question per post, please. It is considered especially rude around these parts to add questions or make other major revisions to a post that has already been answered; make a whole new post for follow-up questions. Also, please read the `indent` documentation carefully and only ask further questions about specific formatting knobs if you really can't find them in there. We've already done you one favor looking up `-pcs`. – zwol Dec 05 '18 at 16:03
  • gnu documentation is a crap. I think they twist for business – Necktwi Dec 05 '18 at 16:07

2 Answers2

1

I believe the option you want is -pcs or, in long form, --space-after-procedure-calls. The most convenient place to find this information is the long list of options to GNU indent from its official manual.

zwol
  • 135,547
  • 38
  • 252
  • 361
1

-pcs is the switch that adds space after the name of a function. Thus -kr -pcs will do what you want.