[SVN] Revision 1189 (Latex)

Allan Odgaard allan at macromates.com
Tue Jun 14 13:44:26 UTC 2005


On Jun 14, 2005, at 15:03, Brad Miller wrote:

> To change the style of \section command I must use  
> support.function.section.latex.  Is this a bug in b12 or am I  
> remembering wrong?

At least there shouldn't be a bug. The problem is that the style for  
support.function overrules the declaration.section style.

> I do not understand the use of the declaration scope for this.

Okay -- declaration is probably a wrong name, but declaration (alone)  
is _not_ ment to be styled. Declaration refers to a larger semantic  
unit in the text, for example declaration.function (prototype),  
declaration.tag (tag with attributes) etc.

So meta would probably have been a better scope name.

> In looking at the wiki I see that entity.name.section gives \section 
> {name} as an example.  Is the intent of the example to say that  
> "name" should be scoped as entity.section.name this makes good  
> sense.  So what should the \section command be scoped as?   
> support.function.. seems a reasonable choice although  
> keyword.control also seems a possibility.

support.function is for all functions from the “support library” (in  
the context of LaTeX, TeX is the language, and the LaTeX commands are  
functions from the “support library”).

So basically I wanted to markup all “commands” as that.

keyword.control is for flow-control. In LaTeX though I made label,  
cite, and ref be keyword.control because they're not entirely unlike  
labels and goto (which we have as keyword.control in other languages).

Following this analogy, I made the argument to the commands  
variable.parameter, but come to think of it, that was probably wrong,  
since we only use that when declaraing the parameter variable (in the  
function prototype) in other languages, and not when actually calling  
the function.

As for this, for text{bf|it|tt} we already have markup.* and for  
section/chapter entity.name.section makes sense -- as for all other  
commands, I guess they shouldn't actually be scoped as anything  
specific, but instead be subject to the other rules of text.latex  
(using recursion).




More information about the textmate-dev mailing list