If by event you refer to the ?event specifier? then this is a legacy thing that I wanted to have removed before the public alpha.
Gotcha, now it all makes sense.
Most appropriate would be ?callback.document.binary-import? ? commands with
that (semantic) class are called prior to TM doing anything with the file attempted opened.
So the "callback.document.binary-import" is called on any file regardless if it is marked as 'binary' (i.e. vs plain text) by TextMate? I was under the impression tm_proj files are plain-text plist files.
Furthermore you want to use attr.rev-path.tmproj as the scope selector so
that your command is only invoked for *.tmproj files.
Could I ask what "rev-path" stands for? Just curious.
This however being an import filter, TM expects your command to provide the
file?s content on stdout, so this isn?t designed to do exactly what you want. I don?t know if you can take it all the way with the info above, but I figured this info would be useful regardless of this specific situation and it might not require many tweaks to support your desired behavior (e.g. TM could be made to act on an ?exit_discard? from your command, and trust your command did the proper thing).
Oh I sure hope I can figure it out from that! :) Thank you so much, I have quite a few plans for bundles so pretty much any info at all regarding the new features is helpful at this point. A list of semantic classes that are internally recognized by TM would make my day but if it's not easily at hand or it will be changing a lot don't worry about it.
I'll post to the list when I have something working to my satisfaction. If I have something worth committing how do you recommend I go about that?
Brandon
On 16 Dec 2011, at 03:54, Brandon M Fryslie wrote:
[…] So the "callback.document.binary-import" is called on any file regardless if it is marked as 'binary' (i.e. vs plain text) by TextMate? I was under the impression tm_proj files are plain-text plist files.
Right — the binary here is because when TM opens a file it goes through:
binary import command → decode to utf-8 → conert to use LF → regular import command → display.
So text/binary wrt. import commands simply refer to wether or not you want to work with the canonical utf-8 / LF representation of the document (as would be appropriate if e.g. stripping whitespace prior to save) or the content as it is on disk.
Furthermore you want to use attr.rev-path.tmproj as the scope selector so that your command is only invoked for *.tmproj files.
Could I ask what "rev-path" stands for? Just curious.
Reverse path. So if you have ‘/tmp/foo.cc’ it has scope ‘attr.rev-path.cc.foo.tmp’.
This allows e.g. to inject matching of ‘<?php … ?>’ tags into ‘text.html & attr.rev-path.php’ to enable it only in HTML files with a php file extension.
[…] If I have something worth committing how do you recommend I go about that?
Put on Github and send a link to it.