[TxMt] Language Grammar for LaTeX log files

Trevor Harmon trevor at vocaro.com
Mon Apr 10 19:06:24 UTC 2006


On Apr 10, 2006, at 6:32 AM, Michael Sheets wrote:

>> {	scopeName = 'source.log.error.latex';
>> 	fileTypes = ( 'log' );
>
> Don't know anything about latex, but using the .log filetype is  
> going to be a bit greedy if this is included in the default latex  
> bundle. Should probably just not include one and let latex users  
> select it manually.

Automatic detection of file types seems to be a weak point in the  
TextMate bundle system. The problem, of course, is that some file  
extensions (e.g., .log, .xml) are overloaded. They could be any one  
of a number of different file types, as Michael pointed out above. (I  
mentioned a similar problem with XML files a couple weeks ago.)

I realize there's a firstLineMatch field that solves this problem in  
situations where a file type must have a "signature" on its first  
line, but a lot of files types don't have this. Perhaps an additional  
(but optional) field is necessary: lineMatch, for example. Like  
firstLineMatch, this would be a regular expression, but instead of  
matching only the first line, it would match any line in the file.  
TextMate could run this regular expression through a file when it's  
loaded, and if it gets a match, it would know the true language of  
the file and could automatically set the file type.

Although there might still be collisions (and maybe performance  
issues when loading large files), it seems to me that this would go a  
long way toward solving the problem mentioned above.

Trevor

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2363 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20060410/1a145b20/attachment.p7s>


More information about the textmate mailing list