[ESS] Syntax highlighting not working for keywords with uppercase letters in ESS[SAS]

Rodney Sparapani rsparapa at mcw.edu
Wed Jan 7 17:09:28 CET 2009


Christian Keller wrote:
> Dear all
> 
> I recently came across a problem with syntactic highlighting in 
> ESS[SAS]. As SAS programming language is not case-sensitive, keywords 
> should be highlighted regardless of being written in lowercase or 
> uppercase letters. However, this is not the case for GNU Emacs 22.3.1 
> (i386-mingw-nt5.1.2600) with ESS 5.3.10.
> 
> Example: In ESS[SAS] the keyword %let is highlighted correctly, whereas 
> %Let or %LET are not highlighted (where they should in my opinion).
> 
> Interestingly, highlighting works correctly in ESS[SAS] for the older 
> emacs version GNU Emacs 22.1.1 (i386-mingw-nt5.1.2600) with ESS 5.3.10.
> 
> As far as I understood the concept of font lock, the variable 
> font-lock-keywords-case-fold-search controls whether keywords are 
> highlighted regardless of their case:
>    Documentation:
>    *Non-nil means the patterns in `font-lock-keywords'
>    are case-insensitive.
> 
> For GNU Emacs 22.3.1 (i386-mingw-nt5.1.2600) with ESS 5.3.10 in ESS[SAS] 
> C-h v font-lock-keywords-case-fold-search gives:
>    font-lock-keywords-case-fold-search is a variable defined
>    in `font-lock.el'.
>    Its value is nil
>    Automatically becomes buffer-local when set in any fashion.
> 
> But for older emacs version GNU Emacs 22.1.1 (i386-mingw-nt5.1.2600) 
> with ESS 5.3.10:
>    font-lock-keywords-case-fold-search is a variable defined
>    in `font-lock.el'.
>    Its value is t
>    Local in buffer test.sas; global value is nil
>    Automatically becomes buffer-local when set in any fashion.
> 
> Has anyone a solution to this problem in GNU Emacs 22.3 with ESS 5.3.10?
> 
> Please note that I used Emacs with the '--no-site-file' startup option 
> for all my tests and my .emacs contains only the line
>    (require 'ess-site)
> 
> 
> Best regards
> Christian

Hi Christian:

I can confirm this is a bug in 22.3.1.  The solution is to edit 
essd-sas.el (it is read-only so you have to make it writable first; if 
you also have an essd-sas.elc, then remove that as well).

On line 201, insert (setq-default font-lock-keywords-case-fold-search t)

If this sounds good to everybody, I can commit this.  But, 22.3.1 seems
pretty buggy to me.  When I launch it, the window is too big for the
screen and when you try to grab it to make it smaller, you often hit
the X button killing it.  XEmacs does not have this annoying problem!

FWIW, I used the Windows installation instructions from the README
thread for both GNU Emacs and XEmacs and they work perfectly.  So, both 
that and the fix should appear in 5.3.11 RSN.

Rodney




More information about the ESS-help mailing list