Maarten Sneep wrote:
This is my first post to this list. I've been a user of BBEdit for many years, and out of curiosity I've decided to check out TextMate. [...]
I must say that I like what I've seen so far, but I have some suggestions:
Well first, welcome. I hope you stick around!
Textmate runs either the current file or a file pointed to in some environment variable. I guess there is an easy way to set this variable, but TeXShop uses a method that is not all that hard to implement; I did so for some BBEdit AppleScripts [1]. The core is actually implemented in a (rather ugly) shell script, you may be able to reuse parts of the script.
TeXShop defines some meta comments, describing the source, and how it can be typeset. From the help-files:
%!TEX TS-program = command [...] %!TEX encoding = encoding [...] %!TEX root = Document
Interestingly, the following patch was checked into the TextMate bundles subversion repository about 7 hours ago:
[SVN] r6277 (Latex); from Kevin Ballard
[NEW] LaTeX now supports master files defined by the TeXShop convention %!TEX root = file It also observes %!TEX TS-program = progname, but at the moment it only cares if progname == xelatex Deleting aux files also observes this way of setting master files
Changed: U trunk/Bundles/Latex.tmbundle/Commands/LaTeX and view.plist U trunk/Bundles/Latex.tmbundle/Commands/Trash aux Files.plist A trunk/Bundles/Latex.tmbundle/Support/lib/options.sh
So it seems that much of what you are looking for is on the way. But as for encoding, TextMate really prefers UTF-8 for everything, so I'm not sure whether things will necessarily be made easier for other encodings.
It would be useful to have a "open selection" command that opens a referenced file, and an open master command. I have some of those in my scripts in my bundle [1], for regular tex files, and graphics files (either open the original metapost source, of open the graphic in preview or so).
How exactly does this work? There are similar commands in a few bundles (I dunno about LaTeX), and you can make TextMate commands pretty flexibly, so I imagine you'll be able to get this to work without much effort.
I imagine Haris and others can answer your questions better than I can. Again, welcome.
Cheers, Jacob Rus