[TxMt] (no subject)

Charilaos Skiadas cskiadas at uchicago.edu
Sun Jan 29 20:21:51 UTC 2006


Hi Nicholas,

On Jan 29, 2006, at 11:20 AM, Nicholas Cole wrote:
> {	name = 'meta.footnote.latex';
> 			begin = '(\\(footnote|noteToSelf)\{)';
> 			end = '(\})';
> 			captures = { 1 = { name = 'keyword.footnote.latex'; }; };
> 			patterns = ( { include = '$self'; } );
> 			contentName = 'variable.parameter.footnote.latex';
> 		},
> 		{	name = 'meta.emph.latex';
> 			begin = '(\\emph\{)';
> 			end = '(\})';
> 			captures = { 1 = { name = 'keyword.emph.latex'; }; };
> 			patterns = ( { include = '$self'; } );
> 			contentName = 'variable.parameter.emph.latex';
> 		},
I see no reason not to add those (except for the noteToSelf part of  
course) to the actual LaTeX bundle, and I'll do that after a bit of  
testing and if no-one has an objection.
>
> I've added that code to a copy of the Language definition.  It  
> seems to work fine (there are probably errors, since I'm a newbie)  
> but it occurs to me that there may be a better way to do it.  As it  
> stands, if the Latex bundle is updated in the next release, I'll  
> still be using the older language definition.  Is there any way I  
> could have written my snippit to avoid that problem?
>
The only way I can think of is to create a new language definition,  
with its own scope, something like text.mylatex, and in its syntax  
add your own patterns and finish the patterns list with a : {	include  
= 'text.latex'; }, just like the latex syntax includes the tex syntax  
via an { include = 'source.tex'; }. Then, when the latex syntax is  
updated, you are in the clear, so to speak.

The problems arising from that, that I can think of, are with  
languages that include text.latex in them, like latex beamer. In that  
case, unless you change those things, your extra stuff will not be  
visible there.

> Best wishes,
>
> Nicholas

Haris





More information about the textmate mailing list