Could Emacs convert C++ braces to hanging while re-indenting buffer? -
when re-indent c++ buffer, i'd convert code this:
void foo(int a) { try { (unsigned int i=0; i<10; ++i) { if (++a) { break; } else { continue; } } } catch (...) { ; } }
to code this:
void foo(int a) { try { (unsigned int i=0; i<10; ++i) { if (++a) { break; } else { continue; } } } } catch (...) { ; }
also, want class definitions , namespaces untouched. functionality exist in emacs?
i realize can done bunch of regexps, it'd nicer use ready-made function handles edge cases , all.
a simple macro job, like:
(setq last-kbd-macro "\c-s{\336\c-e")
followed by: m-0c-xe.
Comments
Post a Comment