I'm new to Emacs, and am trying to learn it for knitting LaTeX and R (using AUCTeX and ESS). In my ~/.emacs I have:
(setq-default TeX-newline-function 'reindent-then-newline-and-indent)
which means that when I press RET AUCTeX applies the proper LaTeX indentation automatically for me. However, in an .Rnw file it seems that ESS overrides the TeX-newline. In an .Rnw file C-h m returns:
RET TeX-newline
(that binding is currently shadowed by another mode)
and C-h k RET returns:
RET (translated from <return>) runs the command ess-noweb-newline,
which is an interactive compiled Lisp function in `ess-noweb-mode.el'.
It is bound to RET.
(ess-noweb-newline &optional ARG)
A kludge to get round very odd behaviour of newline in quoted code.
Basically I only want ESS to override RET when the point is inside an R chunk (<<>> @) or the brackets of an \Sexpr{} expression. Seems to me that this should be the default behaviour, but is there any way to force it?