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

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -