Printable Version of Topic

Click here to view this topic in its original format

Linuxhelp _ Programming in Linux _ Emacs question-formatting code text

Posted by: une Nov 18 2006, 04:52 AM

When writing code in C++ or Java using emacs I notice that I can get the code all nicely aligned and indented correctly by simply adding a comment at the end of each line of code. As you enter the //, the line of code moves to its correct alignment. What I have been doing is writing my code and periodically tidying it up by adding // at the end of every line of code. My question is, can I speed this aligning and indenting process up by formatting the entire file using one command? Emacs obviously knows how much each line should be indented, but doing it one line at a time by adding // is laborious.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)