[ESS] flyspell and Rnw files

Kasper Daniel Hansen kasperdanielhansen at gmail.com
Tue Jun 26 17:18:43 CEST 2012


(Only tangentially related to ESS, but posted here in case some knows).

I use flyspell-mode to spell check my Rnw files.  I have a number of
custom latex command like
  \Rcode{}
  \Rclass{}
I want to disable flyspell checking of what is inside these commands,
like not spell check 'arg' in
  \Rcode{arg}

Googling suggests that this is not straightforward, but it may be possible.

Answers to a related question, in case other people were wondering:
the following enables flyspell in tex chunks, but disables it in R
chunks

(add-hook 'ess-mode-hook
	  (lambda ()
	    (turn-off-flyspell)
	    ))

(add-hook 'LaTeX-mode-hook
	  (lambda ()
	    (turn-on-flyspell)
	    ))

Kasper



More information about the ESS-help mailing list