[ESS] options(error=recover) produces ESS freeze

Peter Meilstrup peter.meilstrup at gmail.com
Mon Nov 9 22:50:23 CET 2009

On Nov 9, 2009, at 5:54 AM, Martin Maechler wrote:
>>> I keep reproducing a very simple recipe for making ESS
>>> and the entire Emacs process freeze:
>>> 1. set options(error=recover) 2. Move to a buffer where
>>> there is a group of statements, one of which will produce
>>> an error. For example:
>>> options(error=recover) library(datasets) avg <-
>>> by(warpbreaks, list(warpbreaks$wool, warpbreaks$tnsion),
>>> function(x)mean(x$breaks))) #previous line generates
>>> error due to typo print(avg)
>>> 3. use C-p or C-r etc. to evaluate the paragraph.
>>> 4. RESULT: emacs becomes completely unresponsive.
>>> This makes ESS darn near unusable for me. This can't be
>>> normal, can it?
>>> I'm using ESS 5.5 with R 2.10.0 on both emacs 22.1.1 (OS
>>> X built in) and Aquamacs (22.3.1).
>>> Can anyone shed light?
>>> Peter
>   {But note: The simply workaround *IS*  'C-g'  aka  "Ctrl G" !! }
> Keith Ponting, in his reproducible example of today, in this thread,
> mentions that the prompt is '^Selection: '
> in his case.
> So one could argue that  ESS  should be fixed and detect
> '^Selection: '  as a prompt.
> The bad news is that with R being multilingual, you only get
> 'Selection: ' if you are in an English language locale, or if
> there's no valid translation available for that R.
> E.g. in a German language locale, you get
>     'Fehler'  instead of 'Error'
> and  'Auswahl' instead of 'Selection'
> Now, we'd need pretty sophisticated code in ESS which would be
> able to catch these things correctly independent of the current
> locale.
> I think a smart solution would be:
> 1) When ESS starts up R, quickly find out what word the current
>   locale uses for  "Error"  and what for "Selection" and store
>   these.
> 2a) Later, ESS "should know" if options(error=recover) is active.
>    {or more generally, just if the 'error' options differs from NULL}
> 2b) In those cases, it should not wait for the default prompt
>    necessarily, but rather for the equivalent of "Selection: "
> Hmm, pretty messy, unfortunately.
> For the moment, I'd rather advertize the workaround
> ---->  ===         ------
> ---->  C-g   aka  "Ctrl G" !!
> ---->  ===         ------

Thanks Martin. Ctrl-G works for now.

Since "Selection:" comes from utils::menu(), which in turn calls  
gettext(), might it be a more general solution to sidestep the  
internationalization issues you raise, and instead have a way to  
detect when utils::menu or gettext is being called, perhaps putting a  
trace on gettext during ESS startup?


More information about the ESS-help mailing list