help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

indent-region to indent comments


From: Suhas Pai
Subject: indent-region to indent comments
Date: Wed, 10 Dec 2003 11:56:20 -0800 (PST)

If I mark a region and indent it, I find that it
only idents the source lines and not the comment lines.
If my comment-column is set, why the indenting skips
comments?  This will save me ton of time having to
do each one using "esc ;".  I could always write a macro
but I don't know how to bind a macro to a key. 

Please help.

Before:
-------

int main(int argc, char **argv)
{
   int a = 5;           // first comment
   double b = 5.0;   // second comment
   long c = 3;   // third comment
   b = a + c; // so as not to get unused variable error

   return 0;
}

Expect after ident-region:
--------------------------
int main(int argc, char **argv)
{
   int a = 5;         // first comment
   double b = 5.0;    // second comment
   long c = 3;        // third comment
   b = a + c;         // so as not to get unused variable error

   return 0;
}


Thanks,
Suhas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]