Once I found in the Wiki a tip to let TextMate auto add * in C comments. That is to say when I press return it goes from
/* * this is a comment...
ro
/* * this is a comment... *
Unfortunately I'm not able to find it anymore.
This was just a "basic" question, since manually adding * and spaces (tab is "rigid" it adds a fixed number of spaces, it does not seem to put the "right" number, that is to say the number that is needed to align with the above content).
A more advanced question is: could a "Doxygen" mode be done?
Is someone doing it?
I suppose it is possible, since it should behave quite like the css mode inside the HTML mode or something like that?
-enrico
On 9/4/2006, at 11:13, Enrico Franchi wrote:
Once I found in the Wiki a tip to let TextMate auto add * in C comments. That is to say when I press return [...]
Create a new snippet (Window => Show Bundle Editor), set the key equivalent to ‘return’ and the scope selector to ‘comment.block’ -- now that snippet is inserted when you press return inside block comments. You could refine the scope selector, e.g. ‘source.c comment.block’ for only block comments in C.
The contents of this snippet should be a newline plus ‘ *’ to have that inserted after the newline.
But since we only want the leading space after a line with ‘/*’, we need conditional insertion. That is, insert ‘ *’ when the current line is the starting line (containing ‘/*’) and otherwise insert ‘*’.
We can do this by doing a regexp replacement on the current line, to detect if it’s the first line, this could be:
${TM_CURRENT_LINE/.*?(/*(?!.**/)).*|.*/(?1: )* /}
It looks a little complex, but it’s rather simple, it does:
1) Try: a) match anything (non-greedy) b) match /* not followed by */ (put in capture 1) c) match the rest of the line 2) If that failed, instead try: a) match the entire line
The replacement then does:
1) If there was a capture 1 a) insert ‘ ’ 2) Insert ‘* ’
Effectively inserting ‘ * ’ if the line matches the ‘is a block start comment’ otherwise only insert ‘* ’.
As discussed not so long ago, a problem is that when the caret is exactly after ‘*/’ the scope is still block.comment, since the scope of the caret is that of the character to the left of it [1]. We could catch this case, and not insert anything, when in that situation, this would make the snippet:
${TM_CURRENT_LINE/(.**/$)|.*?(/*(?!.**/)).*|.*/(?1::(?2: ) * )/}
I leave it as a reader exercise to dissect it.
Remember the actual newline before this regexp substitution.
A more advanced question is: could a "Doxygen" mode be done?
Is someone doing it?
There is a Doxygen bundle at the svn repository.
I suppose it is possible, since it should behave quite like the css mode inside the HTML mode or something like that?
Yes. Currently it would require a (simple) modification to the C language grammar.
I don’t know which keywords Doxygen use, but we could probably ship with markup of these by default.
Long-term there will be a system for keeping such extensions isolated in their own bundle, and only have them used, when that bundle is enabled.
[1] I am currently experimenting with changing it so that the scope of the caret is that of the character to the right of it. Both solutions have disadvantages, but currently it looks like using the character to the right has the fewest.
On 09/apr/06, at 16:22, Allan Odgaard wrote:
As discussed not so long ago, a problem is that when the caret is exactly after ‘*/’ the scope is still block.comment, since the scope of the caret is that of the character to the left of it [1]. We could catch this case, and not insert anything, when in that situation, this would make the snippet:
${TM_CURRENT_LINE/(.**/$)|.*?(/*(?!.**/)).*|.*/(?1::(?2: )
- )/}
Thank you very much. It was really helpful. It was quite time consuming having to "manually" deal with that issues. My I ask why that is not enabled by default?
There is a Doxygen bundle at the svn repository.
I saw it. However it does not do no syntax highlight.
Yes. Currently it would require a (simple) modification to the C language grammar. I don’t know which keywords Doxygen use, but we could probably ship with markup of these by default.
I suppose it is something I could do by myself. I didn't really think the * thing was going to be that simple (a part from the regex hacking i could not possibly think to a simpler way).
Long-term there will be a system for keeping such extensions isolated in their own bundle, and only have them used, when that bundle is enabled.
Very good!
In the meantime I'd like to learn how to customize TM. I suppose I have to: 1) read the manual sections (that is to say sections from 6 to 16 of the manual; I suppose regexes are similar enough to standard pcre I can have a look at them only if something does not behave as expected).
2) read through the wiki... but I did not see "a single place".
3) ?
Maybe there are some user tutorials or similar things. Or would they be in the wiki?
-enrico
Am 9. Apr 2006 um 18:20 schrieb Enrico Franchi:
- ?
Maybe there are some user tutorials or similar things. Or would they be in the wiki?
It all depends on what you are searching for. From my point of view the documentation is not verbose enough and the wiki is not really helping much yet; but then much of this is because I am lacking the vocabulary to search for what I would like to do and such…
I would hope that after you are feeling comfortable getting to know all that stuff you may be posting here, adding to the wiki and doing screencasts like "the rest of us (should)" ;)
btw: How does one do those neat screencasts?
Daniel
On Apr 9, 2006, at 10:33 AM, Daniel Käsmayr wrote:
btw: How does one do those neat screencasts?
One way is with Snapz Pro X:
http://www.ambrosiasw.com/utilities/snapzprox/
It's a little expensive at $70 but I assume it's what most people use.
Trevor
On 9 avr. 06, at 21:35, Trevor Harmon wrote:
On Apr 9, 2006, at 10:33 AM, Daniel Käsmayr wrote:
btw: How does one do those neat screencasts?
One way is with Snapz Pro X:
http://www.ambrosiasw.com/utilities/snapzprox/
It's a little expensive at $70 but I assume it's what most people use.
Trevor
Another solution is iShowU, which is free :
http://ishowu.cloudnine.net.nz/iShowU/Home.html
On Apr 9, 2006, at 2:46 PM, Alakazam wrote:
Another solution is iShowU, which is free :
Good to know; thanks. Looks like it will soon no longer be free, however.
On a slightly off-topic note, why do all the TextMate screencasts seem to be encoded in H.264? This surprises me, given that H.264 is a lossy codec designed for video cameras, not screen capture. As a result, TextMate screencasts often end up rather blurry with lots of artifacting, such as this one:
http://media.libsyn.com/media/beercaster/TextMateRailsBundle320x240.mov
I can hardly read the text on this one. Granted it's the low- bandwidth version, but still, I think the reason a low-bandwidth version had to be made is because H.264 has such a hard time with screen captures. I would think better results could be had without H. 264 and instead by relying on a lossless codec. After all, when using a text editor there's very little change in the display (and thus high compression), and with screen captures there's no analog-to- digital conversion as there would be in video camera sources (and thus no noise that would hurt compression).
For example, I've discovered a codec in QuickTime 7 called "Animation". I haven't done any extensive tests to see how it compares with H.264 for screen capture, but it seems to get good compression with the captures I've done. And one thing is certain: There's absolutely no artifacting as there would be with MPEG-type codecs. The movie is as crisp and clear as a real live display. For example:
http://doc.ece.uci.edu/~tharmon/files/disclabelScreenSnapz001.mov
Any thoughts on this? Has anyone tried the Animation codec for their screencasts?
Trevor
On Apr 9, 2006, at 9:08 PM, Trevor Harmon wrote:
Any thoughts on this? Has anyone tried the Animation codec for their screencasts?
I'm pretty sure that's what I used originally for my LaTeX screencasts. Then I did some editing to increase the volume on them, and I think that might have altered the quality a bit. I'm not entirely happy with the quality, but Animation was definitely better than the alternatives.
Trevor
Haris
On 10/4/2006, at 4:08, Trevor Harmon wrote:
[...] Any thoughts on this? Has anyone tried the Animation codec for their screencasts?
I used Animation for the Objective-C snippets screencast [1] (and for all previous recordings of mine.) Unfortunately I hadn’t noticed that I had Snapz Pro X set to scale it down 70% or so.
On 9/4/2006, at 19:33, Daniel Käsmayr wrote:
btw: How does one do those neat screencasts?
Wikipedia actually has an entry:
http://en.wikipedia.org/wiki/Screencast#Mac_OS_only
I use Snapz Pro X, but in addition to the other free tool mention, there is also vnc2swf, which Duane used for the Rails screencast.
On Apr 9, 2006, at 10:38 PM, Allan Odgaard wrote:
On 9/4/2006, at 19:33, Daniel Käsmayr wrote:
btw: How does one do those neat screencasts?
Wikipedia actually has an entry:
http://en.wikipedia.org/wiki/Screencast#Mac_OS_only
I use Snapz Pro X, but in addition to the other free tool mention, there is also vnc2swf, which Duane used for the Rails screencast.
Just for the record, I used ScreenRecord [1]. I tried vnc2swf and liked it, but couldn't get audio recording to work [2]. I'm 80% happy with ScreenRecord, but 30% of that is due to the reasonable price.
Duane Johnson (canadaduane) http://blog.inquirylabs.com/
[1] http://www.miensoftware.com/screenrecord.html [2] http://blog.inquirylabs.com/2006/03/04/finding-a-screencasting- tool-for-mac-os-x/
On 09/apr/06, at 19:33, Daniel Käsmayr wrote:
It all depends on what you are searching for. From my point of view the documentation is not verbose enough and the wiki is not really helping much yet; but then much of this is because I am lacking the vocabulary to search for what I would like to do and such…
I would like more verbose documentation too. I would appreciate a printed manual too. :)
-enrico
On 9/4/2006, at 18:20, Enrico Franchi wrote:
[ overloading return in comments ] My I ask why that is not enabled by default?
Because I personally do not use this style, and would not want return to insert asterisks when I am inside comments.
When bundles get a toggle per-item we can ship with more of these “smart” features, as they can then just be disabled.
In the meantime I'd like to learn how to customize TM. I suppose I have to:
- read the manual sections (that is to say sections from 6 to 16
of the manual; I suppose regexes are similar enough to standard pcre I can have a look at them only if something does not behave as expected).
For adding DoxyGen keyword support, you could start with chapter 12. If you already know PCRE, then this is not actually any more complex than the * thing in comments.
On 10/apr/06, at 06:35, Allan Odgaard wrote:
Because I personally do not use this style, and would not want return to insert asterisks when I am inside comments.
Ok. That is a very good reason, indeed. ;)
When bundles get a toggle per-item we can ship with more of these “smart” features, as they can then just be disabled.
I suppose this will be a TM 2.0 feat..
For adding DoxyGen keyword support, you could start with chapter 12. If you already know PCRE, then this is not actually any more complex than the * thing in comments.
Very good. I finish a couple of exams here at the university and I dive into it :)
-enrico
On 10/4/2006, at 13:21, Enrico Franchi wrote:
When bundles get a toggle per-item we can ship with more of these “smart” features, as they can then just be disabled.
I suppose this will be a TM 2.0 feat..
Probably 2.1/2.5 -- if I plan too much for 2.0 it will take forever to complete.