Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

C++ indentation question

4 views
Skip to first unread message

Shashank Khanvilkar

unread,
Jan 10, 2013, 12:37:45 AM1/10/13
to
I have existing code that looks like:
--SNIP--
void foo() {
int a;
doSomething();
}
--SNIP--
I need to change this to:
--SNI--
void foo()
{
int a;
doSomething();
}
--SNIP--

How can i do this?

Doug Lewan

unread,
Jan 10, 2013, 7:38:38 AM1/10/13
to Shashank Khanvilkar, help-gn...@gnu.org
I don't think emacs will just change styles for you. You could use `query-replace' M-%.

GNU's indent(1) command might be a better way to go.

,Douglas
Douglas Lewan
Shubert Ticketing
(201) 489-8600 ext 224

When I do good, I feel good. When I do bad, I feel bad and that's my religion. - Abraham Lincoln

jack-mac

unread,
Jan 10, 2013, 9:52:17 AM1/10/13
to
Le jeudi 10 janvier 2013 06:37:45 UTC+1, Shashank Khanvilkar a écrit :
> I have existing code that looks like:
> void foo() {
> int a;
>
> I need to change this to:
> void foo()
> {
> int a;

Type the following sequence:
M-% ) SPACE { C-q RET RET ) C-q RET { RET
and then SPACE or BANG (!)
0 new messages