[ESS] "Bug" when quitting Emacs with R opened

Vincent Goulet vincent.goulet at act.ulaval.ca
Thu Aug 30 19:14:27 CEST 2007


Le mer. 29 août à 09:08, Martin Maechler a écrit :

>>>>>> "VG" == Vincent Goulet <vincent.goulet at act.ulaval.ca>
>>>>>>     on Wed, 29 Aug 2007 00:59:16 -0400 writes:
>
>     VG> [Working with my version of GNU Emacs 22.1 for Windows]
>     VG> If one quits Emacs while an R process is still open  
> (answering "yes"
>     VG> when prompted that a process is still active), a window  
> pops up
>     VG> reporting a problem terminating rterm.exe. Clicking  
> Terminate Now (or
>     VG> whatever the button is labeled, I only have a French  
> version of
>     VG> Windows at hand) seems to solve the problem. I never  
> noticed any
>     VG> particular negative effect of this, it is just annoying  
> since it is
>     VG> not uncommon to leave Emacs without first quitting R.
>
>     VG> This only happened to me on Windows (Linux and OS X being  
> the other
>     VG> OSes tested).
>
>     VG> Can this be "cured" at the ESS level?
>
> Yes, I think so, particularly if you doubly quote the word "cured":
>
> As a Unix (Linux) user, I have had for quite some time
>
>    (custom-set-variables
>
>      ............
>
>      '(inferior-R-args "--no-restore-history --no-save ")
>
>      ............
>
>    )
>
> in my ~/.emacs.  I assume there's something like ~/.emacs also
> in Windows, though it will probably depend on the various settings
> {On my Windows Server setup,
>> path.expand("~/")
>  works nicely in R,
>  and e.g.,
>> file.exists("~/.emacs")
>  gives TRUE, but
>> file.show("~/.emacs")
>  then says that "~/.emacs" does not exist
> }
>
> This "cures" the problem the way I want:
>      It never asks about saving the R workspace or history when  
> finishing the
>      R process and also doesn't try to use a history file.
> This make  C-c C-q  work the way it is useful to me... namely
> quick without any further questions asked.

At first I thought this was not the issue, since I was referring to a  
situation where the R process is not terminated by the user with C-c  
C-q, but rather killed by Emacs upon Emacs shut down. But then I  
checked and indeed, if R is started with the --no-save option, the  
annoying window does not show up anymore.

Why does this occur on Windows only?

> But even if this works on Windows (RGui) the same way,
> I'm not sure if you (Vincent) should put it into your
>     Emacs+ESS_for_R
> setup for the average windows user.
> My impression is they love to work with workspaces and need
> gradually be converted to using R source files instead.

I'm a bit reluctant to impose non-default options to unsuspecting  
users. But then, I already turn off the toolbar, turn on syntax  
highlighting, etc. Furthermore, the --no-restore-history and --no- 
save options settle two difficulties I see my students having when  
they start using Emacs+ESS+R:

1. "Hey, I have this message in the minibuffer saying it can't find  
the history file. What's wrong?"

2. "Everytime I close Emacs [with R started], there's this window  
popping up."

So I might as well make the change in the site-start.el file.

Vincent

>
> Martin




More information about the ESS-help mailing list