As anyone who has ever done programming knows, it doesn't take long for the best laid plans to mess up elegant formatting. I've been unable to find a command that reformats messy C code back to a standard GNU format (or any other for that matter). Have I missed something, or does this command not exist for programming languages?
Thanks.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Dr. Marc R. Feldesman Professor & Chairman Emeritus Anthropology Department Portland State University
please reply to: feldesmanm@pdx.edu my PERS blog: http://persinfo.blogspot.com SKYPE: mrfearless47
Dear Marc,
If, by reformatting, you mean re-indenting the code, the tool you need is called "indent". Just type "man indent" in a shell for details.
Best regards, Mathieu
___________________________________________
Mathieu Godart
Skype: mathieu_godart MSN: mathieu_godart@hotmail.com
ASIC Integration Manager Coolsand Technologies ___________________________________________
Le 20 oct. 08 à 01:08, Marc Feldesman a écrit :
As anyone who has ever done programming knows, it doesn't take long for the best laid plans to mess up elegant formatting. I've been unable to find a command that reformats messy C code back to a standard GNU format (or any other for that matter). Have I missed something, or does this command not exist for programming languages?
Thanks.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Dr. Marc R. Feldesman Professor & Chairman Emeritus Anthropology Department Portland State University
please reply to: feldesmanm@pdx.edu my PERS blog: http://persinfo.blogspot.com SKYPE: mrfearless47
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Marc Feldesman wrote:
As anyone who has ever done programming knows, it doesn't take long for the best laid plans to mess up elegant formatting. I've been unable to find a command that reformats messy C code back to a standard GNU format (or any other for that matter). Have I missed something, or does this command not exist for programming languages?
There's /usr/bin/indent, which is either part of the standard MacOS install or part of the developer package. For the standard GNU format you're probably better off with the GNU variant, which can be obtained through MacPorts http://www.macports.org/. It installs to /opt/local/bin/gnuindent. In general, GNU indent has many more options than the standard version, including quick preset options for the GNU, K&R, and Berkeley styles.
Thanks for this. I know this is how emacs does it, but I was looking to find an internal reformatting command inside TextMate. Not a problem. I can easily create a command to access this version of indent.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Dr. Marc R. Feldesman Professor & Chairman Emeritus Anthropology Department Portland State University
please reply to: feldesmanm@pdx.edu my PERS blog: http://persinfo.blogspot.com SKYPE: mrfearless47
--- On Mon, 10/20/08, Steve King sking@arbor.net wrote:
From: Steve King sking@arbor.net Subject: [TxMt] Re: Fixing indenting/formatting C code To: "TextMate users" textmate@lists.macromates.com Date: Monday, October 20, 2008, 7:42 AM Marc Feldesman wrote:
As anyone who has ever done programming knows, it
doesn't take long for the best laid plans to mess up elegant formatting. I've been unable to find a command that reformats messy C code back to a standard GNU format (or any other for that matter). Have I missed something, or does this command not exist for programming languages?
There's /usr/bin/indent, which is either part of the standard MacOS install or part of the developer package. For the standard GNU format you're probably better off with the GNU variant, which can be obtained through MacPorts http://www.macports.org/. It installs to /opt/local/bin/gnuindent. In general, GNU indent has many more options than the standard version, including quick preset options for the GNU, K&R, and Berkeley styles.
-- Steve King Sr. Software Engineer Arbor Networks +1 734 821 1461 www.arbornetworks.com http://www.arbornetworks.com/
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On 20 Oct 2008, at 18:57, Marc Feldesman wrote:
Thanks for this. I know this is how emacs does it, but I was looking to find an internal reformatting command inside TextMate. Not a problem. I can easily create a command to access this version of indent.
If you only need the indent fixed, as opposed to changing where line breaks are, then you can use Text → Indent Line / Selection.
For my preferred style of indentation, I think it does a surprisingly good job :)