[TxMt] Re: textmate Digest, Vol 43, Issue 37

Allan Odgaard mailinglist at textmate.org
Fri Dec 16 07:12:33 UTC 2011


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.



More information about the textmate mailing list