[TxMt] C indentation prbs

Pavan Gunupudi pavan at doe.carleton.ca
Fri Jun 8 15:33:42 UTC 2007


Thanks for the tips. I might have to go for external indenting apps.  
The thing is I collaborate with people who use Emacs and finding a  
common indentation scheme is kind of important while working on the  
same code base.

Pavan

On 8-Jun-07, at 9:46 AM, James Perry wrote:

> Hello all...
>
> Speaking of external indenting apps, I download and build  
> 'astyle' (Artistic Style) and set up a bundle command Ctrl-Option- 
> Command-[ to run it on the selection or the entire document. Works  
> like a charm. Tons of indentation and style options!
>
> From the Artistic Style web page:
>
> "Artistic Style is a source code indenter, source code formatter,  
> and source code beautifier for the C, C++, C# and Java programming  
> languages."
>
> Have a look at http://astyle.sourceforge.net/ and see if it's what  
> you need. I don't know how it compares with 'indent', any comments  
> on that?
>
> JP
>
>
> On Jun 8, 2007, at 9:15 AM, Steve King wrote:
>
>> On Thu, 7 Jun 2007, Pavan Gunupudi wrote:
>>
>>> The following pieces of code are indented incorrectly by "Indent  
>>> Selection" - ⌥⌘[ . Any fixes?
>>
>> FWIW, I find the best way to handle re-formatting C code is to  
>> filter it through the external 'indent' command.  It's *highly*  
>> customizable and comes with reasonable defaults for a number of  
>> standard formatting styles (GNU, K&R, BSD).  The indent package is  
>> available through MacPorts or can be compiled from source.
>>
>> That said, it would be nice if TM's formatter was a little smarter  
>> about what it does while you're typing, but I can live with it as- 
>> is for now (at least until 2.0 comes out!)
>>
>> -- 
>> Steve King, <steve at narbat.com>
>> _____________________________________________________________________ 
>> _
>> For new threads USE THIS: textmate at lists.macromates.com
>> (threading gets destroyed and the universe will collapse if you  
>> don't)
>> http://lists.macromates.com/mailman/listinfo/textmate
>
>
> ______________________________________________________________________
> For new threads USE THIS: textmate at lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate
>
> -- 
> BEGIN-ANTISPAM-VOTING-LINKS
> ------------------------------------------------------
>
> Teach CanIt if this mail (ID 2351641) is spam:
> Spam:        http://134.117.9.7/canit/b.php? 
> i=2351641&m=83462aad042a&c=s
> Not spam:    http://134.117.9.7/canit/b.php? 
> i=2351641&m=83462aad042a&c=n
> Forget vote: http://134.117.9.7/canit/b.php? 
> i=2351641&m=83462aad042a&c=f
> ------------------------------------------------------
> END-ANTISPAM-VOTING-LINKS




More information about the textmate mailing list