Options for GNU Indent

J

Jonathan M. Rose

Hello All:

I spent several hours last Tuesday and today trying to configure GNU
indent to match my coding style, but I still can't get two items to
work correctly:

1) I prefer the opening brace to a function to be on the same line as
the function name, like (this is similar to a generic Java coding
format):
void myFunction(void) {
...
}

and:

2) I prefer to have two blank lines separate functions:
void myFunction1(void) {
...
}


void myFunction2(void) {
...
}

Can anyone send the correct GNU indent options to achieve these goals,
or tell me whether it is possible at all? Thank you!
--
Jonathan M. Rose
President, Farious Net Solutions
Phone: (866)NET-SOLN; Web: http://www.farious.com
Computer sales and service, Linux deployment and maintenance, low
voltage wiring and Java/database Programming for the northern New
Jersey/New York City area. Call us today!
 
R

Robert Gamble

Hello All:

I spent several hours last Tuesday and today trying to configure GNU
indent to match my coding style, but I still can't get two items to
work correctly:

1) I prefer the opening brace to a function to be on the same line as
the function name, like (this is similar to a generic Java coding
format):
void myFunction(void) {
...
}

Recent versions of GNU indent support the undocumented option -brf
that implements this behavior. Give it a try, if it works great, if
not, update to 2.2.9.
and:

2) I prefer to have two blank lines separate functions:
void myFunction1(void) {
...
}

void myFunction2(void) {
...
}

I only see one blank link in your example. I do not think GNU indent
supports specifying the number of blank lines inserted after a
function body but the program is open source so your could always add
such an option yourself...

Robert Gamble
 
J

Jonathan M. Rose

1) I prefer the opening brace to a function to be on the same line as
Recent versions of GNU indent support the undocumented option -brf
that implements this behavior. Give it a try, if it works great, if
not, update to 2.2.9.


That worked perfectly. Thank you very much.

I only see one blank link in your example. I do not think GNU indent
supports specifying the number of blank lines inserted after a
function body but the program is open source so your could always add
such an option yourself...


Sorry about that - I meant to put two blank lines in there. I tried -
bap2, thinking that might do it, but it didn't work...
--
Jonathan M. Rose
President, Farious Net Solutions
Phone: (866)NET-SOLN; Web: http://www.farious.com
Computer sales and service, Linux deployment and maintenance, low
voltage wiring and Java/database Programming for the northern New
Jersey/New York City area. Call us today!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,016
Latest member
TatianaCha

Latest Threads

Top