SFbay007
SFbay007

Reputation: 2027

Format structure tables in C using emacs

Is there a library that would format structure tables?

something like:

struct a {
char *s;
int c;
int b;
} sample[] = {
{"this is a test", 1, 4},
{"this",3,56544}
};

So the reformatting would be :
} sample[] = {
{"this is a test", 1, 4},
{"this"          , 3, 56544}
};

Upvotes: 1

Views: 64

Answers (1)

Steve Vinoski
Steve Vinoski

Reputation: 20014

Set a region that includes all the values in your sample[] array, and then C-u M-x align that region.

Upvotes: 4

Related Questions