I've probably missed something obvious and/or previously discussed here but...
Is there a standard way to get TM to generate a UUID string for a "mySyntax.plist" file ?
Background:
I've embarked upon a bundle for ConTeXt using the LaTeX bundle as inspiration and liftable source.
I want to generate two Syntax.plist files. One for ConTeXt itself (using material I generated for a BBEdit CLM for ConTeXt) and a trivially modified version of the bibtex.plist file from the LaTeX bundle (so that highlighting works with ConTeXt's \cite[citekey] (as opposed to \cite{citekey}) construct).
Writing the plist files is fairly straightforward (albeit tedious), but I'm wondering about this apparent UUID catch 22:
AFAICT, the syntax.plist file can't be included in the bundle's info.plist file w/o a UUID and if its not included in the info.plist file, it is not recognized as a bundle component. Since the bundle editor does not (yet ?) have a "language editor", I don't see how to get past this w/o manually "guessing" a UUID ?
I'm prepared for a
/slaps head
upon receiving (an) answer(s)
wtia,
mark.
Hi,
You can save it without UUID and TM will generate one for you. However, the content of the bundle will be FUBAR, because it is processed automatically and then written out as xml and any ordering or indentation is completely lost)
Or, you could jump to a Terminal window and type: uuidgen and insert the result in the appropriate place in the plist file.
Jeroen.
On Mar 29, 2005, at 17:03, Jeroen van der Ham wrote:
Or, you could jump to a Terminal window and type: uuidgen and insert the result in the appropriate place in the plist file.
And the latest Language Definition bundle (in the repository) contains a snippet so you can type: uuid<tab> and it'll insert a new UUID.
Some info about the UUID can be found in the wiki: http://macromates.com/wiki/pmwiki?n=Main.Bundles
Also about naming elements when creating new syntax files: http://macromates.com/wiki/pmwiki?n=Main.DevelopingBundles
With regard to the language editor, this is simply not created yet -- the lack of a UUID in your bundle items cause absolutely no functional limitations, since TextMate will, as Jeroen said, add it when it's missing. And you can convert XML back to the ASCII plist format using the 'pl' command.
Thanks Jeroen,
Jeroen van der Ham wrote:
You can save it without UUID and TM will generate one for you. However, the content of the bundle will be FUBAR, because it is processed automatically and then written out as xml and any ordering or indentation is completely lost)
indeed ! I managed to discover this one by myself.
Or, you could jump to a Terminal window and type: uuidgen and insert the result in the appropriate place in the plist file.
aha, as is the case for many CL tools, I did not even know that this existed.
thanks
mark.
p.s. I just stumbled on an alternative way of doing it. In the Bundle Editor, if you make a copy of any bundle component, you can then drag it into another bundle and TM makes a UUID for it. Works for the UI representation of syntax.plists too. *Nice* (as usual)
Hi, Mark,
On 29 Mar 2005, at 15:52, Mark Smith wrote:
Is there a standard way to get TM to generate a UUID string for a "mySyntax.plist" file ?
Both Jeroen & Allan are too fast for me ;-)
Kind regards,
Mats
---- "TextMate, coding with an incredible sense of joy and ease" - www.macromates.com -
Mark, Let me (or the list) know when you finish it. I have a very rough "jerry-rig context bundle I built also off the LaTeX bundle but basically I only use it to run texexec in the pdf browser.
Great to hear your working on a better one.
Cheers Robert
On Mar 29, 2005, at 6:52 AM, Mark Smith wrote:
I've probably missed something obvious and/or previously discussed here but...
Is there a standard way to get TM to generate a UUID string for a "mySyntax.plist" file ?
Background:
I've embarked upon a bundle for ConTeXt using the LaTeX bundle as inspiration and liftable source.
I want to generate two Syntax.plist files. One for ConTeXt itself (using material I generated for a BBEdit CLM for ConTeXt) and a trivially modified version of the bibtex.plist file from the LaTeX bundle (so that highlighting works with ConTeXt's \cite[citekey] (as opposed to \cite{citekey}) construct).
Writing the plist files is fairly straightforward (albeit tedious), but I'm wondering about this apparent UUID catch 22:
AFAICT, the syntax.plist file can't be included in the bundle's info.plist file w/o a UUID and if its not included in the info.plist file, it is not recognized as a bundle component. Since the bundle editor does not (yet ?) have a "language editor", I don't see how to get past this w/o manually "guessing" a UUID ?
I'm prepared for a
/slaps head
upon receiving (an) answer(s)
wtia,
mark. ______________________________________________________________________ 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
Robert Ullrey wrote:
Mark, Let me (or the list) know when you finish it. I have a very rough "jerry-rig context bundle I built also off the LaTeX bundle but basically I only use it to run texexec in the pdf browser.
Great to hear your working on a better one.
Don't go getting your hopes up Robert. My first effort at a bundle. (I did a ConTeXt CLM for BBEdit, but it is limited to the same extent as any codeless language module for BBEdit is currently limited - hence this effort.) I've got very little time for it at the moment and I'm feeling my way.
Maybe we could pool resources ?
I could *try* to tackle the main Syntax.plists initially. Maybe you could do some commands ?
(Due to the diversity of the languages (Perl, Python, Ruby and pure shell scripts - in *none* of which I'm proficient) used in the command scripts in the other bundles, I've not grokked all of the underlying mechanisms in the command scripts. I dare say I'd figure it out sooner or later, but this is probably trivial for a competent scripter.) I was thinking about scripts for the following:
texexec --pdf myFile texexec --xtx myFile bibtex myFile
additionally, combo scripts for:
texexec --[pdf|xtx]--myFile [AND] open in myPreviewer
and maybe even:
texexex --[pdf|xtx] --myFile [AND] bibtex --myFile [AND] texexec --[pdf|xtx] --myFile [AND] open in myPreviewer
mark.
I suspect this is a well known problem.
If strings associated with folding are not always opened and closed in a completely nested fashion, then folding gets into trouble. IOW:
startsomething stopsomething startsomethingelse stopsomethingelse
and
startsomething startsomethingelse stopsomethingelse stopsomething
both fold properly, but:
startsomething startsomethingelse stopsomething stopsomethingelse
(which is permissible in ConTeXt and elsewhere) does not.
Is there a solution for pairing specific delimiters such that e.g.
\stopfrontmatter\ is only a "foldingstopmarker" for \startfrontmatter\
?
Perhaps there is some regex or script trickery that can be used here ? I can see how to include multiple matches for a start block, but not whether there is some way to pair them against individual match strings in the stop block.
If not, can we anticipate the bundle rules being extended to enable multiple pairs of foldingmarkers to be included in a syntax ?
Or something else ?
mark.
On Mar 30, 2005, at 14:32, Mark Smith wrote:
If not, can we anticipate the bundle rules being extended to enable multiple pairs of foldingmarkers to be included in a syntax ?
Currently not possible, but yes, I definitely plan to do something about it. But it's not that simple, since there's a lot of considerations both with regard to different language idioms and what's technically feasible.
Allan Odgaard wrote:
On Mar 30, 2005, at 14:32, Mark Smith wrote:
If not, can we anticipate the bundle rules being extended to enable multiple pairs of foldingmarkers to be included in a syntax ?
Currently not possible, but yes, I definitely plan to do something about it. But it's not that simple, since there's a lot of considerations both with regard to different language idioms and what's technically feasible.
Thanks Allan. I'd welcome improvements here, but I can see that it is a tricky one.
I sent an off-list message to Robert (the other outed-ConTeXter on the list) with a suggestion:
I'm thinking about restricting the delimiting of folding blocks in the bundle to specific commented-out strings and supplying additional snippets which included these commented out folding markers.
So, I'd set the folder marking syntax to:
%start.*\
and:
%stop.*\
which would enable you to fold e.g.:
%startitemize
\startitemize \item blah \item blah blah \item blah blah blah \stopitemize
%stopitemize
Not brilliant, but works for me today.
mark.