Hey, I somehow hosed TextMate's ability to perform the Run Ruby command, and I don't know how I did it, or how to fix. (Or rather, I know how I did it, but I don't understand why it broke.)
Symptom 1: invoking Run Ruby command produces "/usr/local/bin/ruby: No such file or directory -- /Users/ gavinkistner/Library/Application Support/TextMate/Bundles/ Ruby.tmbundle/Supprt/tmruby.rb (LoadError)"
Symptom 2: selecting text and invoking the Lookup Ruby Docs command produces /bin/bash: /usr/bin/ri: /usr/bin/ruby: bad interpreter: No such file or directory
What I did: 1) Despite having /usr/local/bin first in my path[1], TextMate was using /usr/bin/ruby instead of /usr/local/bin/ruby So I used TextMate's preferences and set the TM_RUBY variable explicitly to /usr/local/bin/ruby To be sure, I also moved /usr/bin/ruby to /usr/bin/ruby_apple
2) I was tired of seeing warnings in my ruby output, so I changed the Ruby Ruby command from: ${TM_RUBY:=ruby} -w -- "$TM_BUNDLE_PATH/Supprt/tmruby.rb" "$TM_FILEPATH" to ${TM_RUBY:=ruby} -- "$TM_BUNDLE_PATH/Supprt/tmruby.rb" "$TM_FILEPATH"
...and it broke, complaining about lack of tmruby.rb. (Spotlight confirms that no such file exists on my drive.)
3) I then put the -w back in, and it's STILL broken!
...what happened to tmruby.rb? If I remove that bit and change the command to just ${TM_RUBY:=ruby} "$TM_FILEPATH" I can get ruby code to execute, but I don't get the nice output in the HTML window :|
[1] Output of terminal session, which defaults to tcsh: [Slim:~] gavinkis% setenv PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:. ...extra variables omitted... [Slim:~] gavinkis% bash Slim:~ gavinkistner$ echo $PATH /usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:.
On 10.09.2005, at 16:53, Gavin Kistner wrote:
Hey, I somehow hosed TextMate's ability to perform the Run Ruby command, and I don't know how I did it, or how to fix. (Or rather, I know how I did it, but I don't understand why it broke.)
Symptom 1: invoking Run Ruby command produces "/usr/local/bin/ruby: No such file or directory -- /Users/ gavinkistner/Library/Application Support/TextMate/Bundles/ Ruby.tmbundle/Supprt/tmruby.rb (LoadError)"
Hehe, coincidentally I just had the same problem. Your SVN-checkout version is in /Library/Application Support/TextMate right?
I too removed the -w from the ruby execution line and had the exact same problem. This seems to be due to the nature of the $TM_BUNDLE_PATH variable which doesn't work correctly in custom bundles. As soon as you change something in the default bundle, TextMate creates a copy in ~/Library/Application Support/TextMate, Ruby.tmbundle in our case. And when used from a copied bundle (which does not contain the tmruby.rb aka RubyMate) the $TM_BUNDLE_PATH variable points to your custom application support directory. I circumvented this problem by using the newest build (available here: http://macromates.com/textmate/build/TextMate_r385.zip) and using $TM_BUNDLE_SUPPORT instead of $TM_BUNDLE_PATH, so that my default setup to run Ruby looks like this: ${TM_RUBY:=ruby} -- "$TM_BUNDLE_SUPPORT/tmruby.rb" "$TM_FILEPATH"
I don't have an answer to problem 2, though, but the problem is likely to be the ri command itself, since it relies on /usr/bin/ruby to exist. You could either change it to match your setup (/usr/local/ bin/ruby) or use #!/usr/bin/env ruby as a shebang line in /usr/bin/ri and then set the PATH variable in the TextMate command: PATH=/usr/local/bin:$PATH ri -Tf html "$MY_FUNC_TO_CHECK"
Not tested, but should work ;)
Hope that helps.
Cheers, Mathias
On Sep 10, 2005, at 10:29 AM, Mathias Meyer wrote:
Hehe, coincidentally I just had the same problem. Your SVN-checkout version is in /Library/Application Support/TextMate right?
Indeed it is. :)
Thanks for the explanation, and help. (Thanks for $TM_BUNDLE_SUPPORT, macromates! :)
Since my default shell is tcsh, where do I need to put the command to modify the path env variable that textmate is using?
On 10.09.2005, at 18:57, Gavin Kistner wrote:
Since my default shell is tcsh, where do I need to put the command to modify the path env variable that textmate is using?
Since TextMate is not a console application, I reckon it relies on the PATH variable set (or changed) via the ~/.MacOSX/ environment.plist file (I recommend using RCEnvironment [1] for changing it). But another resolution to the ri problem could be just pointing the TextMate command to /usr/local/bin/ri instead of /usr/ bin/ri ;) If ri has been installed together with Ruby in /usr/local, it will most likely use the corresponding Ruby installation.
Cheers, Mathias
[1] http://www.rubicode.com/Software/RCEnvironment/
On Sep 10, 2005, at 11:08 AM, Mathias Meyer wrote:
Since TextMate is not a console application, I reckon it relies on the PATH variable set (or changed) via the ~/.MacOSX/ environment.plist file (I recommend using RCEnvironment [1] for changing it).
Ah, I'd forgotten about that. Thanks, will try.
But another resolution to the ri problem could be just pointing the TextMate command to /usr/local/bin/ri instead of /usr/bin/ri ;) If ri has been installed together with Ruby in /usr/local, it will most likely use the corresponding Ruby installation.
Yup, that's the resolution I'm aiming for, hence my question about paths. /usr/local/bin/ri is installed as part of a standard ruby build, and does already start with "#!/usr/local/bin/ruby". If I can get TextMate to choose that based on my desired path resolution, then I should be good to go on that front.
Thanks again for your help,
On 10-09-2005 19:34, Gavin Kistner wrote:
But another resolution to the ri problem could be just pointing the TextMate command to /usr/local/bin/ri instead of /usr/bin/ri ;) If ri has been installed together with Ruby in /usr/local, it will most likely use the corresponding Ruby installation.
Even better solution which will solve all the problems: Always use:
#!/usr/bin/env ruby
This will always pick the right ruby according to your path. Even if you put it in /weird/directory/ruby and put it in your path.
Jeroen.
Is it the same for everybody else -- that $TM_BUNDLE_SUPPORT is empty in beta 17? It is for me and this breaks Subversion plus most other commands. K
On 9/11/05, Jeroen van der Ham jeroen@je-ju.net wrote:
On 10-09-2005 19:34, Gavin Kistner wrote:
But another resolution to the ri problem could be just pointing the TextMate command to /usr/local/bin/ri instead of /usr/bin/ri ;) If ri has been installed together with Ruby in /usr/local, it will most likely use the corresponding Ruby installation.
Even better solution which will solve all the problems: Always use:
#!/usr/bin/env ruby
This will always pick the right ruby according to your path. Even if you put it in /weird/directory/ruby and put it in your path.
Jeroen.
-- http://www.je-ju.net/~jeroen/blog/
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
On 16.09.2005, at 21:33, Kumar McMillan wrote:
Is it the same for everybody else -- that $TM_BUNDLE_SUPPORT is empty in beta 17? It is for me and this breaks Subversion plus most other commands. K
As I wrote in one of my first replies, $TM_BUNDLE_SUPPORT has been introduced in the revision 398 build. Check out Allan's blog entry regarding the latest builds (which I'm pretty thankful for, by the way ;): http://macromates.com/blog/archives/2005/09/06/rss-feed-with-latest- build
Cheers, Mathias
On 10/09/2005, at 18.57, Gavin Kistner wrote:
Thanks for $TM_BUNDLE_SUPPORT, macromates! :)
It was Sune's idea -- We're migrating all bundles to use this, so there should no longer be these weird problems with bundles after customization those that had dependencies in the bundle itself :)
Since my default shell is tcsh, where do I need to put the command to modify the path env variable that textmate is using?
Shell commands executed from TM will first source /etc/profile and then the first which exist of the following:
~/.bash_profile ~/.bash_login ~/.profile
So e.g. in ~/.bash_profile place:
export PATH="/usr/local/bin:$PATH"
Just a quick question, I see SO much talk about bundles, checkouts, svs etc (and they all seem to be about problems), but it's all just for getting the latest nightly build, and nothing else, right? Just don't want to miss out on anything ;)
Andreas
On 10/09/2005, at 19.54, Andreas Wahlin wrote:
Just a quick question, I see SO much talk about bundles, checkouts, svs etc (and they all seem to be about problems), but it's all just for getting the latest nightly build, and nothing else, right?
Actually latest nightly build contains latest bundles -- so more like getting latest bundles (before nightly) or for those bundles which are not included with TM.
For the full list of bundles see: http://anon:anon@macromates.com/svn/ Bundles/trunk/Bundles/
You'll find a lot which isn't included by default with the betas.
On 10/09/2005, at 20.02, Allan Odgaard wrote:
Actually latest nightly build contains latest bundles -- so more like getting latest bundles (before nightly) or for those bundles which are not included with TM.
Ah... thanks to Mail.app's wonderful new threading, I didn't see this reply. I thought the nightlies were without bundles.
-- Sune.
Oh, so then I'd probably want to do these checkouts then ... argh, back to work again :(
Andreas
On Sep 10, 2005, at 20:02 , Allan Odgaard wrote:
On 10/09/2005, at 19.54, Andreas Wahlin wrote:
Just a quick question, I see SO much talk about bundles, checkouts, svs etc (and they all seem to be about problems), but it's all just for getting the latest nightly build, and nothing else, right?
Actually latest nightly build contains latest bundles -- so more like getting latest bundles (before nightly) or for those bundles which are not included with TM.
For the full list of bundles see: http://anon:anon@macromates.com/ svn/Bundles/trunk/Bundles/
You'll find a lot which isn't included by default with the betas.
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
On 11/09/2005, at 11.05, Andreas Wahlin wrote:
Oh, so then I'd probably want to do these checkouts then ... argh, back to work again :(
Only if you actually want some of the bundles not included by default. Most users probably don't.
I only work in html/asp/javascript anyways and I probably want to customize them after my Will anyhow ... and I took a look at that page and it began to scream things as terminal and such and I really don't feel like doing that, I'm getting old after all :) I bought a mac to be hazzle free ... as much as possible.
But I still need to learn regexp for complete customization, any good tutorials you know? Is it as hard as it looks?
Andreas
On Sep 11, 2005, at 11:30 , Allan Odgaard wrote:
On 11/09/2005, at 11.05, Andreas Wahlin wrote:
Oh, so then I'd probably want to do these checkouts then ... argh, back to work again :(
Only if you actually want some of the bundles not included by default. Most users probably don't.
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
On 11/09/2005, at 12.10, Andreas Wahlin wrote:
But I still need to learn regexp for complete customization, any good tutorials you know? Is it as hard as it looks?
O'reilly have written a book about them, though I haven't read it, so I can't talk about its usefulness to newbies (but it's probably a good bet).
There's also a tutorial in one of the Perl manuals: man perlre, I haven't read this either, but it's probably more of a reference manual.
They probably look harder than they are, since today regexp languages support _a lot_ of features, but one doesn't have to learn all at once.
E.g. letters and digits are literal matches. So foo will match foo.
Many other characters are special and thus would need to be escaped, e.g. foo+bar would match foo+bar.
. matches any character, except newline. So f.o matches flo, foo, fro, etc.
[a-z] matches the a-z range, could have been another range, or multiple ranges, like [a-fA-F0-9], or we can negate the range [^a-z] to match everything but a-z.
There are then escape characters to match groups of characters, like \w matches word characters, \d matches digits, \s matches spaces (whitespace) etc. Here you can generally negate by uppercasing the letter.
That's most of the “literal” matching. You can specify that the previous match should be applied more than once, e.g.:
a* -- match a 0-n times a+ -- match a 1-n times a{5,7} -- match a 5-7 times
This is greedy, so it will match as many as possible, by adding ?, it will match as few as possible.
If you want to repeat more than a character, you can group stuff with (...), e.g. (foo)+ to match 1 or more occurrences of foo.
That's really the basics. The entire grammar of the Oniguruma regexp library is here: http://www.geocities.jp/kosako3/oniguruma/doc/RE.txt -- it's also a reference manual, but once you know the basics, that's really all you need.
One final thing about regexp's, everything you group (i.e. put in (...)) results in a “capture”, which basically means you can refer to that part (after the match).
E.g. if we search for: <img src="(.*?)"> then the src argument is in capture #1, and we can refer to that using $1 in our replace string. The language grammars also allow you to refer to captures.
I've been trying some time now with the javascript bundle, I get almost everything after your little help there Allan :)
foldingStartMarker = "^\s*([A-Za-z0-9.]+s*=\s*)?(function)\b";
what does the = sign mean? Does \b mean ending bracket? And why isn't the s there escaped, or should it match the letter s how many times you want (considering the * after it)?
match = "^\s*(function)\s*([a-zA-Z_]\w*)\s*\(([^)]*)\)";
This one I get almost completely, except the ([^)]*) part. My only guess is that it means something like how many )'s you want at the end of the string or something, but that hardly seems necessary. Also, is it the matching of meta.function.js that dictates matches in command+shift+t (go to symbol)?
thanks for all the help, I'll obviously be sure to post back the enhanced javascript detection if I ever get it right :)
Andreas
On 13/09/2005, at 14.27, Andreas Wahlin wrote:
I've been trying some time now with the javascript bundle, I get almost everything after your little help there Allan :)
Good to hear!
foldingStartMarker = "^\\s*([A-Za-z0-9.]+s*=\\s*)?(function)\\b";
what does the = sign mean?
That's a literal match, so no special meaning.
Does \b mean ending bracket?
No, it's a word boundary. Basically meaning that the next character needs to be a non-word character (since the previous was a word character).
This is required because if e.g. we want to match the start of a bold tag, we'd do: <b but that would also match <body or anything else starting with b, so instead we do: <b\b The \b isn't matching any characters per se, but is an assertion.
And why isn't the s there escaped, or should it match the letter s how many times you want (considering the * after it)?
It's definitely a bug, should have been escaped :)
match = "^\\s*(function)\\s*([a-zA-Z_]\\w*)\\s*\\(([^)]*)\\)";
This one I get almost completely, except the ([^)]*) part. My only guess is that it means something like how many )'s you want at the end of the string or something, but that hardly seems necessary.
The brackets can contain single characters instead of ranges.
[)] will match ), so [^)] will match anything but ). I.e. [^)]* matches up till the first ). Since we match the actual ), we could also have done:
match = "^\s*(function)\s*([a-zA-Z_]\w*)\s*\((.*?)\)";
So given: “function foo (...)” it matches the ... part, and the ... part is not allowed to contain any )'s.
Also, is it the matching of meta.function.js that dictates matches in command+shift+t (go to symbol)?
Partially, yes.
If you look at the rule, you'll notice it has: captures = { 1 = { name = "storage.type.function.js"; }; 2 = { name = "entity.name.function.js"; }; 3 = { name = "variable.parameter.function.js"; }; };
These are assigning names to the 3 captures in the regexp (i.e. the function keyword, the actual name of the function, and the ... part in parentheses).
If you place the caret on each of these parts (in a javascript source) and press ctrl-shift P, you'll be able to verify this.
Now if you go to the Source bundle (in the Bundle Editor) and look at the Symbol List preferences item, the actual preference is: { showInSymbolList = "1"; }
And the scope selector of that item is: entity.name.function, meta.toc-list
This means that every scope selected by that scope selector should have the showInSymbolList enabled. This is what causes stuff marked up as entity.name.function in javascript to appear in the popup list.
If you look in the CSS bundle or HTML bundle, you'll see that there are additional preference items to place CSS selectors and HTML id arguments in the symbol list as well (since these are not matched by the scope selector above). So the entity.name.function name is only a convention -- everything can go in the popup :)
On Sep 13, 2005, at 6:27 AM, Andreas Wahlin wrote:
foldingStartMarker = "^\s*([A-Za-z0-9.]+s*=\s*)?(function)\b";
Changing the \ to \ ^\s*([A-Za-z0-9.]+s*=\s*)?(function)\b
The above regular expression says: Starting at the start of the line (^) 0) find zero or more whitespace characters (\s*) 1) followed by one or more alphanumeric-or-period characters (the [...]+) 2) followed by zero or more 's' characters (s*) 3) followed by an equals sign (=) 4) followed by zero or more whitespace characters (\s*) 5) except you may skip all of 1-4 if you want, (the ?) (but save 'em if you find 'em) 6) but absolutely find the word 'function' (and save it as well) 7) followed by a word boundary (the \b)
So, that would match: foo.bar= function 1111111=function ......sssss= function function
but would not match: foo.bar = function functional
The lack of escaping of the 's' certainly seems like a mistake. It is intended, I suspect, to allow whitespace around the equals sign.
match = "^\s*(function)\s*([a-zA-Z_]\w*)\s*\(([^)]*)\)";
Changing the \ to \ (again, for standard regexp clarity): ^\s*(function)\s*([a-zA-Z_]\w*)\s*(([^)]*))
The above regular expression says: Starting at the start of the line 1) find zero or more whitespace characters (\s*) 2) followed by the word 'function' (and save it) 3) followed by zero or more whitespace characters (\s*) 4) Followed by a single identifier, saved ([a-zA-Z_]\w*) 5) followed by zero or more whitespace characters (\s*) 6) followed by a literal left parenthesis ( 7) save the characters up until the next right parenthesis [^)]* 8) followed by a literal right parenthesis
So, that would match: function foo11111 ( @#$%Q!#$%@T@$%!@#$ ) functionz()
but would not match: function () function() foo = function()
Because JavaScript can have anonymous functions, depending on the purpose of that match, you may want to make the intermediary identifier optional.
My own question - what is the importance of saving sub-expressions in both of the above cases?
On 13-09-2005 15:00, Gavin Kistner wrote:
My own question - what is the importance of saving sub-expressions in both of the above cases?
They are used for assigning scopes. (which are used for colouring and commands, etc.)
See: http://macromates.com/blog/archives/2005/06/23/language-grammars/#more-43 Under the headline, "Named Captures and Content"
Jeroen.
(CHAIN OF THOUGH, PROBABLY DEPRECATED) Thanks for all the RegExp help ... I'm getting closer but it seems far from a cigar. I tried to add this, after the normal tag declaration (that is, almost first in the language)
{ name = "declaration.tag.html"; match = "<(img)[^>]*(>)"; captures = { 1 = { name = "entity.name.tag.img.html"; }; 2 = { name = "meta.scope.between-tag-pair.html"; }; }; },
It's a modified version of the first code, since no image tags have closing </img> things, but rather <img ... > I removed the \b and the </(\1)> parts. Also the removed the last capture. Now this does indeed make the scope catch entity.name.tag.img.html (is that the correct syntax?) but it does not capture any of the attributes in between. Now from looking at this it seems the only thing that would be captured as meta.scope.between-tag-pair.html would be the final > from the code above, but I tried some other stuff and I always got stuck with either having img tags or attributes, not both :( I also do not really get the inital (?i:( part of the original tag catching code, shouldn't ?'s be used after something to mean 1 or 0 occurrences of that very thing? (I also suppose : is some xml thingie) Just noted that (?:subexp) means "not captured group", but that wouldn't apply here since there's an "i" in between? It feels quite hard after all, since it's difficult to read and understand the underlying ideas with all capture rules. (END CHAIN OF THOUGHT)
DID SOME MORE RESEARCH and found out that perhaps I should rather have edited further down and popped in something like { name = "declaration.tag.html"; begin = "<(img)"; end = ">"; captures = { 1 = { name = "entity.name.img.tag.html"; }; }; patterns = ( { include = "#tag-stuff"; } ); },
which makes sense given the repository and the tag-stuff, but this doesn't seem to do anything either, and if this is the place where tags are caught (which seems likely since it worked rather fine even when i removed the code mentioned above), what does the { name = "declaration.tag.html"; match = "<(?i:(head|table|thead|tbody|tfoot|tr|td|div| fieldset|style|script|ul|ol|li|form|dl))\b[^>]*(>)</(\1)>"; captures = { 1 = { name = "entity.name.tag.html"; }; 2 = { name = "meta.scope.between-tag-pair.html"; }; 3 = { name = "entity.name.tag.html"; }; }; },
part do?
Lots of questions, I know. Hate to be a bother and all that but I've spent quite some time trying to get my head around this and it would be nice to get to the bottom of it. I hope I haven't overlooked any obvious source that tells me all the answers. I have looked in the TextMate blog and also on the RegExp that textmate is said to follow (though not overly studied either source). Hope I'm not being overly lazy by posting all these questions instead of fighting it out like a man with a big manual.
hehe, as a final, light note, I entered the word bar in a file and then tried to a regexp find for both bar\w bar\w (bar)\w (bar)\w but neither found it, what was wrong with that?
Andreas
On 13/09/2005, at 21.35, Andreas Wahlin wrote:
I tried to add this, after the normal tag declaration (that is, almost first in the language)
Not sure which version of TM you're using. A recent revision (i.e. nightly build) changed the “longest match” to just first rule which matches. Thus your specific stuff should be _above_ the generic catch all stuff.
[...] but I tried some other stuff and I always got stuck with either having img tags or attributes, not both :(
Well, to catch the attributes, there needs to be actual rules to match them.
I also do not really get the inital (?i:( part of the original tag catching code, shouldn't ?'s be used after something to mean 1 or 0 occurrences of that very thing? (I also suppose : is some xml thingie) Just noted that (?:subexp) means "not captured group", but that wouldn't apply here since there's an "i" in between?
These are options, noted in the doc as: (?imx-imx:subexp) option on/off for subexp
The (?i:...) means that ... should be matched case insensitive.
DID SOME MORE RESEARCH and found out that perhaps I should rather have edited further down and popped in something like { name = "declaration.tag.html"; begin = "<(img)"; end = ">"; captures = { 1 = { name = "entity.name.img.tag.html"; }; }; patterns = ( { include = "#tag-stuff"; } ); },
which makes sense given the repository and the tag-stuff, but this doesn't seem to do anything either
That rule would markup an img tag with attributes (you may want to add \b after img). If it doesn't do so, try moving it to the top of the grammar (since it may just be, that the generic tag rule is used instead).
[...] what does the { name = "declaration.tag.html"; match = "<(?i:(head|table|thead|tbody|tfoot|tr|td|div| fieldset|style|script|ul|ol|li|form|dl))\b[^>]*(>)</(\1)>"; [...] part do?
This is a special rule to match empty tag pairs like <div></div> with only one purpose: to give a scope to the position between the start/ end tag, so that return can be overloaded for that position (there is a snippet in the HTML bundle which inserts two newlines and extra indent, which is bound to return and the scope which marks the position between the two tags).
hehe, as a final, light note, I entered the word bar in a file and then tried to a regexp find for both bar\w bar\w (bar)\w (bar)\w but neither found it, what was wrong with that?
Probably you wanted bar\b -- \w is a word character.
Oh, ABOVE the stuff, it all seems to work now, just to check back that I did the right thing, and perhaps to have it included in HTML syntax later on? My bundle file now looks like this:
{ name = "declaration.tag.html"; begin = "<(img)\b"; end = ">"; captures = { 1 = { name = "entity.name.img.tag.html"; }; }; patterns = ( { include = "#tag-stuff"; } ); }, { name = "declaration.tag.html"; begin = "</?(div)\b"; end = ">"; captures = { 1 = { name = "entity.name.div.tag.html"; }; }; patterns = ( { include = "#tag-stuff"; } ); }, { name = "declaration.tag.html"; begin = "</?([a-zA-Z0-9:]+)"; end = ">"; captures = { 1 = { name = "entity.name.tag.html"; }; }; patterns = ( { include = "#tag-stuff"; } ); },
The last one there was in the original, and is just there to show where I placed the rest :) Is the name syntax correct? I'm planning on adding scopes for form tags as well, all in order to emulate dreamweaver syntax colouring some day. (The img tag was for bbedit syntax)
The (?i:...) means that ... should be matched case insensitive.
oh, that means I should probably have begin = "<(?i:img)\b"; in the match to catch all <IMG tags as well ... but that, again sadly, does not seem to work :(
Andreas
On 14/09/2005, at 11.17, Andreas Wahlin wrote:
[...] Is the name syntax correct?
Looks okay, yes.
I'm planning on adding scopes for form tags as well, all in order to emulate dreamweaver syntax colouring some day. (The img tag was for bbedit syntax)
You may be interested to know that Michael Sheets has been working on an XHTML strict syntax which not only mark up every single tag/ attribute, but also marks up invalid stuff (like badly nested tags, text where no text is allowed etc.)
It's in the Experimental HTML bundle at the repository, but it'll be included when he gives the green light.
The (?i:...) means that ... should be matched case insensitive.
oh, that means I should probably have begin = "<(?i:img)\b"; in the match to catch all <IMG tags as well ... but that, again sadly, does not seem to work :(
Because (?options:subexp) is not a capture, so you actually need: begin = "<((?i:img))\b";
An alternative form would be: begin = "(?i)<(img)\b";
You may be interested to know that Michael Sheets has been working on an XHTML strict syntax which not only mark up every single tag/ attribute, but also marks up invalid stuff (like badly nested tags, text where no text is allowed etc.)
It's in the Experimental HTML bundle at the repository, but it'll be included when he gives the green light.
WOW! That is a humongous task, and one that will be great once it's done I'm sure :) Is it possible to get it from somewhere over at http://anon:anon@macromates.com/svn/Bundles/trunk/ ?
Andreas
On 15/09/2005, at 11.11, Andreas Wahlin wrote:
You may be interested to know that Michael Sheets has been working on an XHTML strict syntax which not only mark up every single tag/ attribute, but also marks up invalid stuff (like badly nested tags, text where no text is allowed etc.) It's in the Experimental HTML bundle at the repository, but it'll be included when he gives the green light.
WOW! That is a humongous task, and one that will be great once it's done I'm sure :) Is it possible to get it from somewhere over at http://anon:anon@macromates.com/svn/Bundles/trunk/
Yes, like Allan said it's in the 'Experimental HTML bundle at the repository'. So that would be http://anon:anon@macromates.com/svn/Bundles/trunk/Bundles/ Experimental HTML.tmbundle, I suppose.
-- Sune.
On 15/09/2005, at 11.35, Sune Foldager wrote:
WOW! That is a humongous task, and one that will be great once it's done I'm sure :) Is it possible to get it from somewhere over at http://anon:anon@macromates.com/svn/Bundles/trunk/
Yes, like Allan said it's in the 'Experimental HTML bundle at the repository'. So that would be http://anon:anon@macromates.com/svn/Bundles/trunk/Bundles/ Experimental HTML.tmbundle, I suppose.
So the exact instructions to get a local copy, if you already have svn:
cd ~/Library/Application\ Support/TextMate/Bundles svn co --username anon --password anon 'http://macromates.com/svn/ Bundles/trunk/Bundles/Experimental HTML.tmbundle'
Then restart TM and there's a new Experimental HTML bundle with the grammar.
When you want to update it (since it's work in progress), do:
svn up ~/Library/Application\ Support/TextMate/Bundles/Experimental \ HTML.tmbundle
http://anon:anon@macromates.com/svn/Bundles/trunk/Bundles/ Experimental HTML.tmbundle, I suppose.
oh, blast, didn't see that one. Sorry :(
So the exact instructions to get a local copy, if you already have svn:
cd ~/Library/Application\ Support/TextMate/Bundles svn co --username anon --password anon 'http://macromates.com/svn/ Bundles/trunk/Bundles/Experimental HTML.tmbundle'
Then restart TM and there's a new Experimental HTML bundle with the grammar.
When you want to update it (since it's work in progress), do:
svn up ~/Library/Application\ Support/TextMate/Bundles/Experimental \ HTML.tmbundle
Or just copy/paste from the webpage? In any case, that seems to be really cool stuff and when it's ready and taken advantage of by some good themes, TextMate should begin to shine quite proudly amongst web editors (even more so than now hehe)
Andreas
On 15/09/2005, at 14.30, Andreas Wahlin wrote:
So the exact instructions to get a local copy, if you already have svn:
cd ~/Library/Application\ Support/TextMate/Bundles svn co --username anon --password anon 'http://macromates.com/svn/ Bundles/trunk/Bundles/Experimental HTML.tmbundle' [...]
Or just copy/paste from the webpage?
You can do that as well! :)
On 10/09/2005, at 19.54, Andreas Wahlin wrote:
Just a quick question, I see SO much talk about bundles, checkouts, svs etc (and they all seem to be about problems), but it's all just for getting the latest nightly build, and nothing else, right? Just don't want to miss out on anything ;)
The betas, at least, and sometimes the latest builds are necessary to exploit some of the features of the bundles, as they are updated quite often without preserving compatibility.
The nightly builds don't ship with bundles, so a checkout from the repository is needed. I think the betas contain a few bundles, but I am not sure.
-- Sune.