auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX] font-latex-built-in-keyword-classes - minor errors and omis


From: Ralf Angeli
Subject: Re: [AUCTeX] font-latex-built-in-keyword-classes - minor errors and omissions
Date: Fri, 15 Apr 2011 17:23:39 +0200

* Rasmus Villemoes (2011-04-07) writes:

> Errors:
>
> ("documentclass" "[{")
> ("usepackage" "[{")
>
> These both take an optional trailing argument.
>
> ("renewenvironment" "*{[{{")
>
> Should be the same as newenvironment, i.e., two optional arguments.

Thanks, corrected.

> ("sbox" "{")
>
> \sbox "officially" takes two arguments, but it may be on purpose that
> only the first is fontified as such.

Yes, it could be on purpose.  Likely to avoid that a lot of text is
fontified and defeats other fontification.

> ("newcounter" "{[") is in the "function" section, but probably belongs
> logically to the "variable" section (where setcounter and addtocounter
> already live).

All the "new..." stuff is in the function section.  The distinction
between the groups is quite arbitrary anyway, so I left this alone for
now.

> "include" is listed under "warning" and under "reference" (in the
> latter as taking "{"); while "input" and "includeonly" are
> "function"s, both taking a mandatory argument. Is there a reason
> \include is fontified as a warning (while also being treated as a
> "reference" command), and not simply treated the same as \input and
> \includeonly?

\include is treated as a warning because it adds a pagebreak.  It was
probably added to the reference keywords as well so that its argument is
fontified.  (Arguments of warning keywords are not fontified.)  I don't
really recall why it's a reference keyword and not a function keyword.

> Omissions:
>
> Is there a good reason why \providecommand is not included by default?
> Actually, there are a number of macros which I believe belong to the
> built-in list:
>
> "warning"
>
> "makeatletter" "makeatother"
> (when a user needs these in order to apply some patch or tweak, I
> think it makes sense fontify these as warnings)

Warnings are quite flashy, so I'd like to keep them to a minimum.  (We
already have to much of those.  For example I personally dislike that
the &'s in tables are fontified as warnings.)  Does anybody think that
\makeatletter and \makeatother deserve a warning status?

> "variable"
>
> ("stepcounter" "{")
> ("refstepcounter" "{")
> ("arabic" "{") [also roman, Roman, alph, Alph, fnsymbol]
> ("settoheight" "{{") ("settodepth" "{{") [settowidth is included]

I've added those.

> "function"
>
> ("parbox" "[[[{{")
> ("rule" "[{{")
> ("raisebox" "{[[{")
> ("providecommand" "*|{\\[[{")

Regarding the boxes I'm not really sure if those should be added because
as mentioned above, they could contain quite some text which should
better not all be painted in one color.

> When editing (or just viewing) .cls and .sty files, it would also be
> nice if these (and perhaps some of the often-used @-macros) were recognized. 
>
> ("LoadClass" "[{[")
> ("RequirePackage" "[{[")
> ("ProvidesClass" "{[")
> ("ProvidesPackage" "{[")
> ("ProvidesFile" "{[")
> ("PassOptionsToPackage" "{{")
> ("PassOptionsToClass" "{{")
> ("LoadClassWithOptions" "{[")
> ("RequirePackageWithOptions" "{[")
>
> I don't know if a very large list of keywords slows down fontification
> too much. If that is the case, I'd like to ask: Is there a hook I can
> use to add these keywords automatically when viewing .sty and .cls
> files, but not .tex (or .ltx)? 

AUCTeX does not distinguish between those, so you might have to use a
more low-level hook to add the keywords.  Like `find-file-hook'.  But I
haven't tried this, so I'm not sure if it works.

-- 
Ralf



reply via email to

[Prev in Thread] Current Thread [Next in Thread]