[SVN] XHTML syntax suggestion

Mats Persson mats at imediatec.co.uk
Tue May 3 20:50:45 UTC 2005

On 3 May 2005, at 10:52, Max Williams wrote:
> Firstly, I hope I'm not treading on anyone's toes by making  
> suggestions about how a syntax might be created, but I would love  
> to help in its evolution.

Max, absolutely no toes to be stepped on around here. At least none  
that I'm aware off. Just the occasional bruised ego when Allan shows  
me (us?) amateurs how clever he is  ;-)

> I've been thinking about the proposed xhtml syntax, and a few ways  
> it could be made to represent the structure of the relevant dtd. ie  
> include allowed elements etc.
> Would it be possible to name scopes based on the captures, and then  
> include the relevant attributes (this is mainly directed at Allan).
> eg:
> begin = "<(foo|bar)";
> end = "(\\s*/>|</\\1>)";
> name = "keyword.markup.element.{capture1}.xhtml";
> patterns = {
>     include= "{capture1}.plist";
> };
> in the capture file for that tag could be required/allowed  
> attributes and elements that are allowed within it.

I think something like this, or parts there off, would be really  
great.  I am still wondering about the whole structure in regards to  
code completion etc down the road if that's what Allan is planning  
and us users would really want/think useful.

Although having said that, I am more of the opinion that TM should  
support multiple layers/levels of snippets ie: sub-dirs within the  
Snippets folder, and some type of scope handle for knowing that we  
are within a html attribute of a specific type and that only a  
certain number of snippets should be available. Most of that can be  
done today to a limited extent, but not all.

Oh, while I'm on the subject, Allan, any chance to make the pop-up  
menu - when you have multiple snippets on the same tab trigger - to  
show up where the caret is rather than the mouse ?? (cause I always  
put my mouse to the side of the screen when I'm not using it)

> Also, as far as I can see, there is no easy way to tell if  
> something is missing, eg a highlight an image tag that doesn't have  
> an "alt" attribute.

I don't think there will ever be a syntax option for that, nor do I  
see the need for it really.  There are already <img...> snippets that  
have the required bits in them that should be used instead for the  
correct bits, and more snippets will come as and when I/others have  
the time to do them.

There is a basic Tidy implementation already around, but I'm planning  
on improving the Tidy stuff down the road, but that's for another  
day ;) I'm too damn tired right now ;)

Kind regards,


"TextMate, coding with an incredible sense of joy and ease"
- www.macromates.com -

More information about the textmate-dev mailing list