[ESS] Browser and NL when evaluating code block

Cássio M. M. Pereira cassiomartini at gmail.com
Thu Oct 4 20:56:48 CEST 2012

Hi Vitalie,

Pasting the lines has the behavior you described, but in general I
don't do that.

I commonly write scripts to a file and run them with source() when debugging.

If I run R and source("test.R"), execution stops at the browser() line
and b is not assigned.

This seems the most logical and useful behavior if I explicitly set
that NL should be disabled
in browser mode.

Here's what the manual says:

"Setting option ‘"browserNLdisabled"’ to ‘TRUE’ disables the use of
     an empty line as a synonym for ‘c’.  If this is done, the user
     will be re-prompted for input until a valid command or an
     expression is entered."

Is there another way to circumvent this besides adding { } to all my
main scripts?


On Thu, Oct 4, 2012 at 2:49 PM, Vitalie Spinu <spinuvit at gmail.com> wrote:
>   >> Cássio M. M. Pereira <cassiomartini at gmail.com>
>   >> on Thu, 4 Oct 2012 13:33:08 -0300 wrote:
> [...]
>   > But this is not being respected when using C-c C-b to evaluate a buffer.
>   > Consider this simple example:
>   > a = 1
>   > browser()
>   > b = 2
> Wrong use of browser(). This happens only on top level. Because browser
> is entered and then next line is executed immediately. Try to paste
> those lines in R console :)
> This one works fine:
> {
>   a = 1
>   browser()
>   b = 2
> }
>     Vitalie

Cássio M. M. Pereira

More information about the ESS-help mailing list