From timhesterberg at gmail.com  Wed Jun 11 01:50:12 2008
From: timhesterberg at gmail.com (timhesterberg at gmail.com)
Date: Wed, 11 Jun 2008 01:50:12 +0200 (CEST)
Subject: [Rd] browser() exits when not desired,
	in three different scenarios (PR#11623)
Message-ID: <20080610235012.6E04F282EFF7@mail.pubhealth.ku.dk>

Here are three different scenarios in which the browser() exits
when I don't want it to.  These are all related to the browser
accepting either c or (return) to exit.  I would like an option
to turn off the (return) behavior in order to avoid these problems.



# Case 1 - when calling help
# Note, I am using ESS in emacs; this is probably an interaction
# with ESS handling of ? help.
> f <- function(x){
+   browser()
+   length(x)
+ }
> f(1:4)
Called from: f(1:4)
Browse[1]> ?rep
[1] 4
>
# The help was given, but the browser exits.


# Case 2 - when pasting in a command that stretches over
# two lines.
# With f defined as above, call f, select the following two lines in
# an emacs buffer (using c-w clipboard-kill-ring-save) and yank them
into the *R* buffer:
mean(x,
     trim = .2)
# The result:
> f(1:4)
Called from: f(1:4)
Browse[1]> mean(x,
     trim = .2)

mean(x,
+      trim = .2)
[1] 2.5
Browse[1]>
[1] 4
>
# The multi-line command was echoed (twice--this is probably an ESS
problem or misconfiguration), ran, and the browser exits.


# Case 3 - when pasting in a line at a time, including blank lines.
I like to include blank lines in my code for readability.
When I paste in multiple lines, the blank lines cause the browser
to exit.

I reported case 3 before; it is the single thing that bothers
me most about R.  Someone suggested using
ess-eval-line-and-step in ESS; this is nice for one line, but does not
support C-u for sending multiple lines, and doesn't apply when
I'm not using ESS.

Tim Hesterberg

--please do not edit the information below--

Version:
 platform = i486-pc-linux-gnu
 arch = i486
 os = linux-gnu
 system = i486, linux-gnu
 status =
 major = 2
 minor = 7.0
 year = 2008
 month = 04
 day = 22
 svn rev = 45424
 language = R
 version.string = R version 2.7.0 (2008-04-22)

Locale:
LC_CTYPE=en_US;LC_NUMERIC=C;LC_TIME=C;LC_COLLATE=C;LC_MONETARY=C;LC_MESSAGES=en_US;LC_PAPER=en_US;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US;LC_IDENTIFICATION=C

Search Path:
 .GlobalEnv, package:stats, package:graphics, package:grDevices,
package:utils, package:datasets, package:showStructure, package:Rcode,
package:splus2R, package:methods, Autoloads, package:base

	[[alternative HTML version deleted]]



[Rd] browser() exits when not desired, in three different scenarios (PR#11623)
timhesterberg at gmail.com