Pedro Melo | 1 Jan 02:19 2008

Re: Converting dense XML to easy-to-read form?

Hi,

On Dec 28, 2007, at 4:46 AM, Eric O'Brien wrote:

> I am not *writing* XML files, but I often want to understand one --  
> either just for education or because I need to modify it.
>
> Often the file in question was automatically generated and "ease of  
> reading by humans" was not part of the process.

The Tidy command of the XML bundle does format the XML snippets I  
give it.

xmllint --format - < in_file.xml > out_file.xml

does what you want. I think it is what the XML tidy command uses.

Best regards,

> Right now, I trying to pull apart a XML file where a single element  
> contains about 90 attributes.  Thankfully, they *do* seem to be  
> ordered alphabetically, but they are all run together in a single  
> line.  That is, there are no linefeeds between attributes.  Which  
> would be just what I'd like (for readability anyway -- I'm hoping  
> that "white space is white space and it won't matter whether those  
> white-spaces are space characters or line feeds).
>
> For this file, using Find and Replace seems to work.  (Find  
> <doublequote><space> replace with <doublequote><newline>).  I don't  
> know enough about XML to know if it always going to be as easy as  
(Continue reading)

Andy Armstrong | 1 Jan 15:39 2008
Picon

Perl language definition: switch, case?

I'm just updating the Perl language definition to support the new  
keywords and operators in 5.10. I notice that keyword.control.perl  
includes 'switch' and 'case' (which aren't Perl keywords; it's given/ 
when in 5.10) and also 'select' which is a function rather than a  
control keyword.

Is there a compelling reason not to remove switch, case and move  
select to the functions list?

Also, because I'm a TM language definition newbie, does anyone have  
any tips about how to handle the // (defined or) operator? In some  
contexts // is an empty regex; in others it's an operator

my  <at> x = split //, $line;	# regex, common idiom to chop into chars
my $x = $y // $z;		# operator, equiv: my $x = defined $y ? $y : $z

--

-- 
Andy Armstrong, Hexten

Craig Rose | 3 Jan 03:59 2008
Picon

Objective-C Bundle

Hi all

I've been using the Objective-C bundle for about a year now for all my Cocoa coding. It has a lot of nice features, but there are few shortcomings and I was wondering if anyone is actively working on this.

A few things off the top of my head:

- No completion of new classes in leopard (eg. NSGradient, Core Animation classes) or any syntax highlighting for new Objective-C 2.0 features.

- Cocoa classes are automatically highlighted (eg. declaring a variable as NSRect will show "NSRect" highlighted). Other Apple classes like those in CoreGraphics should also get the same treatment. Declaring a variable as a CGRect won't show "CGRect" highlighted. Also help doesn't work for these items.

- "Completion: Partial Method Signature" is really handy for inserting delegate method signatures. It does however insert different spacing then the "Interface/Class Method" snippet.
For example in an interface file:
 Typing "-awakeFromN<tab>" will insert "-(void)awakeFromNib;"
Typing "m<tab>" will insert "- (id)method:(id)anArgument;" (notice the extra space after the "-")

-






Hans-Joerg Bibiko | 3 Jan 09:31 2008
Picon

scope question/problem

Hi,

I have two bundles 'R' and 'R daemon'. R has the scope 'source.r' and  
R daemon has the scope 'source.rd-console'.

In both bundles I have a macro which is bound to the key '(' which  
actually do the same but using different ways. Fine.

If I am inside the R scope 'source.r' the correct macro is called  
after pressing '('.
BUT if I am inside R daemon scope 'source.rd-console' the wrong macro  
is called – meaning the macro of scope 'source.r' will be executed!

If I set the scope selector of the macro inside of the 'R' bundle to:

source.r -source.rd-console

then it works.

Well, to be honest, I don't see the point here why I have to exclude  
a scope explicitly. Or is this a naming-of-scopes issue?

Thanks in advance,

--Hans
Hans-Joerg Bibiko | 3 Jan 09:58 2008
Picon

Re: scope question/problem

Hi,

I just figured out that I have NOT to exclude the scope if I have two  
commands (no macros) which are bound to the same key for the scopes  
'source.r' and 'source.rd-console' (?)

Does the behaviour of macros differ?

--Hans

Jeremy Wilkins | 3 Jan 10:49 2008
Picon

Rails bundle with Rails 1.2

Hi,

I've currently working on a project that targets Rails 1.2, not 2.0.  
I've just run 'convert to partial' and got a 2.0 style xxxx.html.erb,  
is there an env var or similar I can set to make it use .rhtml instead?

Are there likely to be any other 2.0 only gotchas in the new release?

Thanks

jebw

Ian Piper | 3 Jan 11:51 2008
Picon

Keybinding for ^> doesn't work in Leopard

Hi all,

I'm sure this used to work for me... I used ctrl + shift + ">" as a  
shortcut for <% %> or <%= %>

I have been trying this today and it doesn't work. I have recently  
upgraded to Leopard. I also use a Matias Tactile Pro 2 keyboard (but I  
have tried my Apple BT keyboard and my PowerBook keyboard with the  
same effect).

I had a look at the KeyBindings page on the website and also tried Key  
Codes. I also checked out the Console log and couldn't see anything  
obvious.

Can anyone guide me towards a resolution of this?

Thanks,

Ian.

Alex Podaras | 3 Jan 12:11 2008
Picon

Re: Keybinding for ^> doesn't work in Leopard

Hello,

Are you sure you are in the right context "HTML (Rails)".
Also try running the command "Insert ERB' s" from the Bundles > Select  
Bundle Item... dialog

Regards,
Alex

On Jan 3, 2008, at 12:51 PM, Ian Piper wrote:

> Hi all,
>
> I'm sure this used to work for me... I used ctrl + shift + ">" as a  
> shortcut for <% %> or <%= %>
>
> I have been trying this today and it doesn't work. I have recently  
> upgraded to Leopard. I also use a Matias Tactile Pro 2 keyboard (but  
> I have tried my Apple BT keyboard and my PowerBook keyboard with the  
> same effect).
>
> I had a look at the KeyBindings page on the website and also tried  
> Key Codes. I also checked out the Console log and couldn't see  
> anything obvious.
>
> Can anyone guide me towards a resolution of this?
>
> Thanks,
>
>
> Ian.
>
> ______________________________________________________________________
> For new threads USE THIS: textmate@...
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate

Piero D'Ancona | 3 Jan 18:56 2008
Picon

try mdfind

Hi all. Did you try the new mdfind? it's really fast.
Test it like this: create a command
"Find and Open in Finder"
Input: selected text or line
Output: Discard
Text of the command:

mdfind "kMDItemDisplayName == ${TM_CURRENT_LINE}" | xargs open

If you put the cursor on a line containing
a filename (no path, just the filename complete
of its extension) and issue the command,
spotlight will search for the file and open it.
On my MacBookPro it takes 1/3 sec which
means ten times faster than using the GUI.

Just a test, of course one can do much better
things. For a list of a file metadata 
(like kMDItemDisplayName above) use the command
mdls  filename

Ciao
(and a happy new year)
Piero

Ian Piper | 3 Jan 22:58 2008
Picon

Re: Keybinding for ^> doesn't work in Leopard

Thanks Alex,

That was quite stupid of me. I was indeed in the wrong context. I was  
in "Ruby on Rails". The keybinding works fine now that I have the  
right context. Thanks for your help.

Ian.
--

On 3 Jan 2008, at 11:11, Alex Podaras wrote:

> Hello,
>
> Are you sure you are in the right context "HTML (Rails)".
> Also try running the command "Insert ERB' s" from the Bundles >  
> Select Bundle Item... dialog
>
> Regards,
> Alex
>
> On Jan 3, 2008, at 12:51 PM, Ian Piper wrote:
>
>> Hi all,
>>
>> I'm sure this used to work for me... I used ctrl + shift + ">" as a  
>> shortcut for <% %> or <%= %>
>>
>> I have been trying this today and it doesn't work. I have recently  
>> upgraded to Leopard. I also use a Matias Tactile Pro 2 keyboard  
>> (but I have tried my Apple BT keyboard and my PowerBook keyboard  
>> with the same effect).
>>
>> I had a look at the KeyBindings page on the website and also tried  
>> Key Codes. I also checked out the Console log and couldn't see  
>> anything obvious.
>>
>> Can anyone guide me towards a resolution of this?
>>
>> Thanks,
>>
>>
>> Ian.
>>
>> ______________________________________________________________________
>> For new threads USE THIS: textmate@...
>> (threading gets destroyed and the universe will collapse if you  
>> don't)
>> http://lists.macromates.com/mailman/listinfo/textmate
>


Gmane