[ESS-bugs] Font lock bugs in R mode

Ari Kornfeld ari at perspective.com
Tue Feb 21 08:09:40 CET 2006


First the part we all agree on.  Here's some code that illustrates the 
font-lock "nesting" problem on warnings:

---Sample code:

## options(warn=1)  # or type warnings() at the end.
long.fun.spec<-function(long.argument.1, long.arguments.2, long.arguments.3) {
     warning("Notice missing close paren on the previous line.")}

for (idx in 1:100) long.fun.spec(long.argument.1=1, long.arguments.2=2,long.arguments.3=c(1,2,3,5,6,9,0))
warnings()

--- end code.

If you add and extra closing paren to the warning message in the code 
above, the parser never gets confused. But in general, one doesn't have 
control over warning messages, since they come from prepackaged code.

Thanks again for looking into it.

Now about the T/F issue.  I don't feel strongly about this but aren't 
you splitting hairs a bit finely? If R is a dialect of S and some 
(most?) S dialects define T/F as constants (which, I assume, is why you 
don't object to treating T/F as constants in *S files), why not treat 
the goose like the gander?

  Best regards,
-ari


Martin Maechler wrote:
>>>>>> "tony" == A J Rossini <blindglobe at gmail.com>
>>>>>>     on Sun, 12 Feb 2006 12:22:59 +0100 writes:
>>>>>>             
>
>     tony> I definitely agree with the bugs you raise for #2 and
>     tony> on, about warning messages.
>
> so do I; and thank you for the patches;
> I won't get time to look at them for the next several days, though.
>
>   
....
> as one of the two "feeling strongly" : I'm even strongly against
> providing this non-feature !
> It would encourage "wrong" R programming, and we definitely
> don't want this!   I even know of someone who learned to use
> TRUE/FALSE  just because ESS stopped to (wrongly) highlight T/F
> in R-mode !
>
>     tony> I'm assuming that you are referring to R, and not S or
>     tony> S-PLUS.
>
> Indeed;  they are still highlighted in *.S files
>
> Martin
>
>
>




More information about the ESS-bugs mailing list