[SVN] Adding ZPT scope to the HTML Bundle ok?

Michael Sheets mummer at whitefalls.org
Sun Feb 4 08:07:57 UTC 2007


On Feb 3, 2007, at 6:54 AM, Tom Lazar wrote:

> I'm about to add a Bundle for Zope[1] to the Bundles repository and  
> would like to ask if it was okay to -- after commiting it -- to add  
> `text.xml.zpt` to the scope of the snippets and commands of the  
> HTML bundle.
>
> ZPT is the XML-based templating language Zope uses. Itself it  
> doesn't conform to HTML or XHTML so our syntax definition for it  
> extends the `text.xml` language. In order to use the many useful  
> HTML snippets though, we would need to add `text.xml.zpt` to their  
> scope.

Work with the scope system, not against it. ;)

ZPT isn't all that different from the many other template languages  
Textmate supports, all of them use text.html.<lang> for the root  
scope. Yes it might be that the template language can do other  
things… but likely it's mostly for HTML no? We've got likely what 25+  
html-ish template languages now, if each one got to add things to the  
html bundle it'd be a mess.

If it absolutely can't be done any other way you could have two root  
scopes (surround the whole grammar in a rule), but really I doubt  
that's needed.

And of course I always sound negative when I hammer in the scope  
system, which is not how I try to come off but. ;) Really great to  
see new languages added to the repository so fast. Was amazing at  
Macworld to look into the bundles directory and see 143 bundles, and  
more added since then!


More information about the textmate-dev mailing list