[ESS] Bug or feature?

Marius Hofert marius.hofert at math.ethz.ch
Mon Dec 31 00:47:16 CET 2012


Vitalie Spinu <spinuvit at gmail.com> writes:

>   >> Marius Hofert <marius.hofert at math.ethz.ch>
>   >> on Mon, 31 Dec 2012 00:00:29 +0100 wrote:
>
>   > Dear ESS developers,
>   > I work with ESS 12.09-1 (2012-12-21) (under Ubuntu 12.10 with Emacs 24). If I
>   > use C-c C-n to linewise step through an R script and if I end up on the last
>   > line of the script (but continue to use C-c C-n), then this line is executed
>   > again and again... is this a bug or a feature? 
>
> Feature. The idea is to prevent the cursor to jump to the end of the
> buffer. So all the eval-and-step commands stop at the last line. This is
> very convenient when you have commented code, spaces or emacs local
> variables at eob.
>
> The annoying part is that the process stops on the last line, and not
> on, a more natural, next blank line after the last line. 

... which would avoid the last line to be executed several times...

The problematic behavior with the last line being executed repeatedly is the
following: 

Assume you have some critical issue with random numbers, and have, as last line
of your script, the code

,----[ just a simple example: ]
| x <- rnorm(10)
`----

Now, you don't watch your script while stepping through linewise, but typically
the R buffer directly. The problem is, that you now get different random numbers
repeatedly. Let's say that you already notice that you reached the last line
after it has been executed twice -- and then continue to work with 'x' and run
into some R bug. Your script would not reproduce the bug (unless it also appears
for the first assignment of 'x' of course). ... this might cause a lot of
trouble in finding the bug. 

> I am aware of this and had in plan to fix, but never got down to it. Now, that
> there is an explicit request, I will try to find some time to fix.

okay, great!

>
>
>     Thanks, 
>     Vitalie
>
> BTW: ess-eval-region-or-line-and-step is also bound to C-RET, which
> arguably is faster than C-c C-n.

This is awesome!


I just noticed that my mails do not reach the mailing list if they are
signed. ... not sure how this can be solved.



More information about the ESS-help mailing list