[ESS] no color on functions that are R built in like "lm" or "mean"

Vitalie Spinu spinuvit at gmail.com
Wed Aug 8 13:07:54 CEST 2012

Hi Paul, 

I have been using personal tweaks to highlight functions for years. And
I must definitely say that it's a nice thing, as it helps distinguish
what is what.  As far as I know all other editors also highlight

So I have just incorporated my font-lock tweaks into trunk. Feel free to
check it out.


  >> Paul Johnson <pauljohn32 at gmail.com>
  >> on Wed, 8 Aug 2012 00:13:51 -0500 wrote:

  > Sorry, this got sent as I was re-organizing. Now I see it is better to
  > just ask simply:

  > What words are colorized in Emacs/ESS on your system? I just see a few...

  > And:

  > If you wanted to get color on functions like "lm" "mean" "sd" how
  > would you do it?

  > pj

  > On Tue, Aug 7, 2012 at 11:55 PM, Paul Johnson <pauljohn32 at gmail.com> wrote:
  >> I haven't thought about color-coding of kewords in Emacs/ESS in a long
  >> time. A student pointed out something that seems different than I
  >> remember.
  >> Didn't Emacs with font lock have coloring for common R functions like
  >> c, rep, and so forth?
  >> Here are the colors I see now in Emacs ESS
  >> 1. A few functions are colorized.
  >> The word "library" is in turquoise.  As far as I can tell, it is the
  >> only function whose name is colorized.
  >> 1. all comments in red
  >> 3. The left hand side is blue when defining a function.. I mean, if I type
  >> purble <- function(xy){
  >> mean(x)
  >> }
  >> The word purple is purple and function is blue.
  >> 4. Strings--things in quotes, are purple.
  >> I still have the awful/frustrating behavior that a comment like
  >> ## I'm frustrated this does not work
  >> treats the part after the single quote as the beginning of a character
  >> string and everything after the "'" turns purple, until another "'" is
  >> found.
  >> But, I digress.
  >> In th old days, weren't there standard colors for common R functions
  >> like lm, rep, and others?
  >> The students asked me to installl Notepad++ with NPPTOR on the lab
  >> systems, along with some guy's "language coloring" syntax file.
  >> But I remember the old days when the highlighting in Emacs/Ess was
  >> more prolific. Am I just remembering it wrong?
  >> My system is Debian with:
  >> emacs                                        23.4+1-3
  >> ess                                          12.04-4-1
  >> and the .emacs file has
  >> (global-font-lock-mode t) ; turn on syntax highlight
  >> and a lot of other crap in it:  If I am not seeing the colors you do
  >> see, then it probably means I've loaded some crap that breaks
  >> highlighting.
  >> (setq text-mode-hook (quote (turn-on-auto-fill text-mode-hook-identify)))
  >> pj
  >> --
  >> Paul E. Johnson
  >> Professor, Political Science    Assoc. Director
  >> 1541 Lilac Lane, Room 504     Center for Research Methods
  >> University of Kansas               University of Kansas
  >> http://pj.freefaculty.org            http://quant.ku.edu

More information about the ESS-help mailing list