(sorry if this pops up multiple times - gmail doesn't seem to be working properly)
I've recently started using Textmate and the Latex bundle. I found that I wanted to extend the functionality in various ways, including by adding definitions to the Lanuage file to allow me to highlight footnotes and emphasised text. Some of the code I wanted to add is:
{ 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'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?
Best wishes,
Nicholas
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
I just recently noticed the subversion integration, and I have to say Allan, YOU FCKING ROCK!!!!!!!!!
But, when I click a folder in the project drawer and do an svn status, I get this message:
svn status /Users/eric/Sites/projecta subversion/libsvn_wc/lock.c:377: (apr_err=155007) svn: '/Users/eric/Sites/projecta' is not a working copy
I am well aware that ~/Sites/projecta isn't a working copy. I have my folder laid out like so:
~/Sites/projecta/ admin/ <- admin package (this is an svn working copy) client/ -> client package (this is an svn working copy)
In txmt i have just dragged the 2 admin and client folders in, so that my project draw looks like:
/admin ... ... /client ... ..
What could be the cause of this?
Eric Coleman
home: 412 399 1024 cell: 412 779 5176
On 29/1/2006, at 22:28, Eric Coleman wrote:
I just recently noticed the subversion integration, and I have to say Allan, YOU FCKING ROCK!!!!!!!!!
Thanks -- credit for this particular bundle should however mainly go to Chris Thomas and Torsten Becker :)
But, when I click a folder in the project drawer and do an svn status, I get this message: [...] What could be the cause of this?
The status command uses the project directory (and falls back on current files directory). I guess there is no harm in letting it favor a selected folder in the project drawer. I'll make that change.
On Jan 29, 2006, at 8:50 PM, Allan Odgaard wrote:
On 29/1/2006, at 22:28, Eric Coleman wrote:
But, when I click a folder in the project drawer and do an svn status, I get this message: [...] What could be the cause of this?
The status command uses the project directory (and falls back on current files directory). I guess there is no harm in letting it favor a selected folder in the project drawer. I'll make that change.
I've already committed a partial fix. :) It needs a little more attention (path prefix trimming is broken, because the formatting script assumes a single incoming root path), but it does provide accurate status for multiple selections.
Chris
Thanks :)
You guys are da bomb!
Eric Coleman
home: 412 399 1024 cell: 412 779 5176
On Jan 29, 2006, at 9:24 PM, Chris Thomas wrote:
On Jan 29, 2006, at 8:50 PM, Allan Odgaard wrote:
On 29/1/2006, at 22:28, Eric Coleman wrote:
But, when I click a folder in the project drawer and do an svn status, I get this message: [...] What could be the cause of this?
The status command uses the project directory (and falls back on current files directory). I guess there is no harm in letting it favor a selected folder in the project drawer. I'll make that change.
I've already committed a partial fix. :) It needs a little more attention (path prefix trimming is broken, because the formatting script assumes a single incoming root path), but it does provide accurate status for multiple selections.
Chris
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
Hello,
When I press the UPPER button on my keyboard, the ACTIVE row (the one with the darker background) goes UP. When I press down, the active row goes down.
When I press PgUp or PgDown, the TEXT in TextMate goes Up or Down, but the active row stays where it was. So, when I found text with pressing PgUp, and I start to type, Textmate JUMPS back to the row where I left off before pressing PgUp.
Can we setup textMate so that, when pressing PgUp or PgDown the ACTIVE Row follows me?
FYI; I use TextMacro now to handle my END and HOME keys.
Thank you. -- Sincerely,
Patrick Mast, xHarbour.com Inc. http://www.xHarbour.com
On 30 Jan 2006, at 13:01, Patrick Mast wrote:
When I press PgUp or PgDown, the TEXT in TextMate goes Up or Down, but the active row stays where it was. So, when I found text with pressing PgUp, and I start to type, Textmate JUMPS back to the row where I left off before pressing PgUp.
Hi,
This is the standard behaviour for PgUp/PgDown on mac.
Take a look here for changing key-bindings:
http://macromates.com/blog/archives/2005/07/05/key-bindings-for- switchers/
-- Fred
Hey fred,
When I press PgUp or PgDown, the TEXT in TextMate goes Up or Down, but the active row stays where it was. So, when I found text with pressing PgUp, and I start to type, Textmate JUMPS back to the row where I left off before pressing PgUp.
This is the standard behaviour for PgUp/PgDown on mac. Take a look here for changing key-bindings: http://macromates.com/blog/archives/2005/07/05/key-bindings-for- switchers/
Got it! ;-)
Thanks. -- Sincerely,
Patrick Mast, xHarbour.com Inc. http://www.xHarbour.com