[ESS] disable font lock

Stephen Eglen S.J.Eglen at damtp.cam.ac.uk
Mon Nov 5 19:03:11 CET 2007

 > I want font-lock-mode to be disabled whenever I open an R file, but I can't
 > get it to work. I have the following in my .emacs file:
 >   (global-font-lock-mode nil)
 > This seems to work fine for other modes I use (perl, HTML, C++) but not ESS.
 > I also tried:
 >   (add-hook 'ess-mode-hook (lambda () (font-lock-mode 0)))
 > but that didn't work either. Any suggestions?
 > I'm seeing this on two systems:
 >   - ESS 5.3.0 and Emacs 22.1 on Linux
 >   - ESS 5.3.6 and Emacs 21.3.1 on Windows XP
Dear Joey,

Try the following:

(add-hook 'ess-mode-hook (lambda () (font-lock-mode 0)) t)

Note that the 't' at the end is crucial -- by default, ess-mode-hook
has a call to turn-on-font-lock (which perhaps we might want to
reconsider, in cases like this.)  By putting your hook at the end, it
gets run last.

This is a workaround at least...!


More information about the ESS-help mailing list