Bug 14472 - Have an option to disable using "return" key to exit the browser in debugging mode
Have an option to disable using "return" key to exit the browser in debugging...
Status: CLOSED FIXED
Product: R
Classification: Unclassified
Component: Wishlist
R 2.12.1 patched
All All
: P5 enhancement
Assigned To: R-core
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-13 13:22 UTC by Feng Li
Modified: 2011-01-14 18:14 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Feng Li 2011-01-13 13:22:36 UTC
It is so annoying to jump out of the debugging mode unexpectedly when I don't want to. I guess some of us have encountered at least one of these situations,

1, Accidentally pressed the enter key within the browser.

2, Copy and paste a piece of debugging code containing empty lines to the prompt within the debugging mode and

3, If I paste a piece of code to the prompt to debug as follows, it will eventually jump out before I can do anything.

####### copy starting from this line ##############
test <- function()
{
     x<- 5
     browser()
     y<-4
}

test()

######## end of copy at this line ################

I admit that I can always avoid this problem if I don't insert the new line and don't press the enter key and don't use the command cat("\n") in the debugging mode. But that not always convenient and practicable for debugging.

Prof. says "this is part of the parser, and there is no way to turn it off" at present. So I wish to let the debugger to have an option to disable return key for jumping out the debugging mode in the future.

If you also have this problem, please *vote for this feature*. It would be great if someone can provide a patch.


Feng Li

--
Feng Li
Department of Statistics
Stockholm University
106 91 Stockholm, Sweden
http://feng.li/
Comment 1 Brian Ripley 2011-01-13 20:01:10 UTC
This seems a reasonable request as it only affects user interactions.

The suggestion is to control it via a logical option 
"browserNLdisabled", unless anyone can come up with a better name.

On Thu, 13 Jan 2011, r-bugs@r-project.org wrote:

> https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14472
>
> Brian Ripley <ripley@stats.ox.ac.uk> changed:
>
>           What    |Removed                     |Added
> ----------------------------------------------------------------------------
>             Status|NEW                         |ASSIGNED
>
> -- 
> Configure bugmail: https://bugs.r-project.org/bugzilla3/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are the assignee for the bug.
>
> _______________________________________________
> R-core list: https://stat.ethz.ch/mailman/listinfo/r-core
>


-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


Comment 2 Brian Ripley 2011-01-14 13:59:50 UTC
On Thu, 13 Jan 2011, luke-tierney@uiowa.edu wrote:

> Another possibility might be a user-customizable command table for
> browser with "" correspodning to the current behavior and
> removing/modifying that entry being a way to disable this.


The problem I see is that there are two versions of this (browser() vs 
debug() with subtle differences, including whether the browser is in 
single-step mode).  And the implementation of 'empty line' is separate 
from the others in the REPL.   So adding a command table is far more 
work than I at least want to do on this.

I've added option("browserNLdisabled"), but would be happy to change 
the name if we had consensus on a better one.

Brian

>
> Best,
>
> luke
>
> On Thu, 13 Jan 2011, Prof Brian Ripley wrote:
>
>> This seems a reasonable request as it only affects user interactions.
>> 
>> The suggestion is to control it via a logical option "browserNLdisabled", 
>> unless anyone can come up with a better name.
>> 
>> On Thu, 13 Jan 2011, r-bugs@r-project.org wrote:
>> 
>>> https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14472
>>> 
>>> Brian Ripley <ripley@stats.ox.ac.uk> changed:
>>>
>>>           What    |Removed                     |Added
>>>
>>> 
>>> ----------------------------------------------------------------------------
>>>             Status|NEW                         |ASSIGNED
>>> 
>>> -- 
>>> Configure bugmail: 
>>> https://bugs.r-project.org/bugzilla3/userprefs.cgi?tab=email
>>> ------- You are receiving this mail because: -------
>>> You are the assignee for the bug.
>>> 
>>> _______________________________________________
>>> R-core list: https://stat.ethz.ch/mailman/listinfo/r-core
>>> 
>> 
>> 
>
> -- 
> Luke Tierney
> Statistics and Actuarial Science
> Ralph E. Wareham Professor of Mathematical Sciences
> University of Iowa                  Phone:             319-335-3386
> Department of Statistics and        Fax:               319-335-3017
>   Actuarial Science
> 241 Schaeffer Hall                  email:      luke@stat.uiowa.edu
> Iowa City, IA 52242                 WWW:  http://www.stat.uiowa.edu
>
> _______________________________________________
> R-core list: https://stat.ethz.ch/mailman/listinfo/r-core
>


-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


Comment 3 Brian Ripley 2011-01-14 18:14:38 UTC
Basic implementation is in place in R-devel (pre-2.13.0)