Feng Li
2011-Jan-12 22:00 UTC
[R] How to disable using "enter" key to exit the browser in debugging mode
Dear R, How can I disable using "enter" key to exit the browser() in debug mode? I would love to have this option because it is so annoying to jump out of the debugging mode unexpectedly when I don't want to. I guess some of us have encouraged 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. 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 ################ Any suggestions are most welcome! Feng -- Feng Li Department of Statistics Stockholm University 106 91 Stockholm, Sweden http://feng.li/ [[alternative HTML version deleted]]
Gene Leynes
2011-Jan-13 00:29 UTC
[R] How to disable using "enter" key to exit the browser in debugging mode
That also drives me crazy! I don't have that problem when I use the StatEt plug-in for Eclipse. Of course, using a new IDE is a big undertaking, but I can assure you: it's worth it! This is just one small benefit. On Wed, Jan 12, 2011 at 4:00 PM, Feng Li <m@feng.li> wrote:> Dear R, > > How can I disable using "enter" key to exit the browser() in debug mode? I > would love to have this option because it is so annoying to jump out of the > debugging mode unexpectedly when I don't want to. I guess some of us have > encouraged 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. > > 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 ################ > > > Any suggestions are most welcome! > > Feng > > -- > Feng Li > Department of Statistics > Stockholm University > 106 91 Stockholm, Sweden > http://feng.li/ > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
Prof Brian Ripley
2011-Jan-13 11:20 UTC
[R] How to disable using "enter" key to exit the browser in debugging mode
You do not mean the "enter" key: it is not that which exits the browser but rather a newline (which can be entered via 'return', and in other ways). This is part of the parser, and there is no way to turn it off. Somehow other experienced R users have never encountered this. But if you wish you could submit this as a 'wishlist' request to R-bugs, and if enough users support it (and especially if someone submits a high-quality patch to do this), it might be added in a future release. On Wed, 12 Jan 2011, Feng Li wrote:> Dear R, > > How can I disable using "enter" key to exit the browser() in debug mode? I > would love to have this option because it is so annoying to jump out of the > debugging mode unexpectedly when I don't want to. I guess some of us have > encouraged 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. > > 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 ################ > > > Any suggestions are most welcome! > > Feng > > -- > Feng Li > Department of Statistics > Stockholm University > 106 91 Stockholm, Sweden > http://feng.li/ > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Brian D. Ripley, ripley at 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