[ESS] problem with ess-transcript-clean-region

Tony Plate taplate at gmail.com
Fri Jan 15 04:27:23 CET 2010

Stephen, thanks for checking. 

My Ubuntu installation is 9.04
I have Emacs GNU Emacs 22.2.1 (i486-pc-linux-gnu, GTK+ Version 2.14.1)
 of 2008-09-05 on vernadsky, modified by Ubuntu
I have ESS version "5.7.1".

I've discovered that sometimes this error manifests, and sometimes it 
doesn't. Details follow.

Here's how I see the incorrect behavior manifest itself:

C-x b *Rtemp* <RET>       # Create a buffer *Rtemp*
M-x s-transcript-mode <RET>
M-x toggle-read-only <RET>
paste in the following text:

 > x <- list(list(a > 0),
+           list(b > 0), list(c >= 0),
+           list(d > 0), list(e > 0))
 > x <- (a > 0
+           & (b > 0) & (c >= 0))

C-x h                                  # select all contents of buffer
C-x C-x                               # move point to end of buffer
M-x ess-transcript-clean-region <RET>

Then I see the following in the buffer:

x <- list(list(a > 0),
0), list(c >= 0),
0), list(e > 0))
x <- (a > 0
          & (b > 0) & (c >= 0))

However, if I visit a non-existent file "foo.Rt" (which in my setup is 
also ESS Transcript mode, which I guess is standard as I don't see 
anything in my .emacs to map this), and paste in the same text, then run 
ess-transcript-clean-region, it works correctly.

The two expressions above are the only lines in the transcript.  It does 
seem to make a difference whether I created the buffer by visiting a 
file, or by just creating a new buffer (which seems strange).

-- Tony Plate

Stephen Eglen wrote:
> hi Tony,
> I've just tried to replicate this behaviour, but can't(on Emacs 23.1 and
> latest ESS, linux).  I put the two expressions you sent into a file, small.Rt,
> and then tried ess-transcript-clean-region on the buffer, but got the
> correction indentation.    Were these expressions the only lines in your
> transcript?
> The change from replace-regexp to re-search-forward seems to follow the
> advice in the docstring of replace-regexp, so if there is a bug I'd bet
> its on our side, not Emacs.
> thanks, stephen

More information about the ESS-help mailing list