Hi All,

While attempting to avoid real work, I appear to have found a possible
cause for this kind of error.

See the .Rnw file below.

Essentially, it appears that an apostrophe ' will confuse
ess-smart-underscore and it then believes that it is in a string, where the
normal behaviour does not occur.

Another apostrophe fixes the problem. I hope this proves useful.


\documentclass{article}

\begin{document}

<<packages, echo=FALSE, results=hide>>=
i.can.haz.assginment <- TRUE
@

Now, we will introduce an extraneous apostrophe, for no reason '

<<test2>>=
#ess-smart-underscore-no-longer-works
@

'
<<test3, echo=TRUE, results=verbatim >>=
nowitdoes <- cat("Note the apostrophe above which closes the earlier one\n")
@

\end{document}

I have attempted to localise the problem more precisely, but have not had
much success.

------------------------------

Message: 2
Date: Tue, 30 Oct 2012 09:52:41 +0100
From: Martin Maechler <maechler@stat.math.ethz.ch>
To: Denis Haine <denis.haine@gmail.com>
Cc: ess-help@r-project.org
Subject: Re: [ESS] noweb file and assignment key
Message-ID: <20623.38233.125316.345970@stat.math.ethz.ch>
Content-Type: text/plain; charset="us-ascii"

>>>>> Denis Haine <denis.haine@gmail.com>
>>>>>     on Mon, 29 Oct 2012 11:26:36 -0400 writes:

    > Hello, After upgrading to emacs 24 (emacs 24.2.1, ess
    > 12.09) I noticed the underscore key is not mapped anymore
    > to the R/S assignment sign when into a Rnw buffer. The
    > underscore key is still correctly giving the assignment
    > sign when into a R buffer. How can I restore the usual
    > underscore behavior in a noweb buffer?  Thanks for your
    > help,

I'm pretty sure this was not a universal problem.
Our group here uses ESS 12.09 (I'm using the development version),
and we use Sweave ( *.Rnw ) very very often.
Nobody has told me about such a problem.

Couldn't it be that it happens exactly in the situation where
The switch from  R mode ("code chunk")  to  latex mode  ("text chunk")
does not quite work... and we know that happens not so
infrequently.  But you can always work around that by "re
syncing" or sometimes easiest by re-opening the *.Rnw file.

Martin

    > Denis


-- 
Irish Research Council for Humanities and Social Sciences Scholar 2009-11
School of Applied Psychology, University College Cork.
021 490 4608
r.morrisroe@ucc.ie
r.morrisroe@umail.ucc.ie

	[[alternative HTML version deleted]]

