ESS+R not closing gracefully

Damon Wischik djw1005 at cam.ac.uk
Mon Mar 3 12:57:28 CET 2003


I am having trouble with ESS+R. I don't know if it is an ESS
problem or an R problem; I posted this message to the R-help
mailing list and was told it's probably an issue in ESS/Emacs/Windows.

I am using R 1.6.2, Windows XP (latest updates installed), XEmacs 21.4,
and ESS 5.1.21. I have experienced the same problem under Windows 2000 and
recent versions of Emacs and ESS (though my current Windows XP
installation is from scratch, and I've lost details of my old
configuration).

I start up XEmacs. I press M-R to start an R session. I straightaway do

> quit()

and it quits cleanly.

Now I try something else. I start up XEmacs. I press M-R to start an R
session. I do

> hist(rnorm(10))
> dev.off()
null device
          1
> quit()
Save workspace image? [y/n/c]: n

and then it fails to quit. The Windows task manager tells me that the
process Rterm.exe is taking up 95% or so of CPU time. If I forcibly quit
it, using the Windows task manager, I see in the XEmacs window:

Process R exited abnormally with code 1 at <time>.

If, from the Windows command prompt, I run rterm, and do

> hist(rnorm(10))
> dev.off()
> quit()

it quits cleanly. This also happens if I run rterm --ess from the command
prompt.

In case it is relevant, I have made one change to the ESS file
ess-site.el: I added

(setq-default inferior-R-program-name
  "c:\\program files\\R\\bin\\Rterm.exe")

(since otherwise it couldn't find Rterm.exe, even though it is on my
path); also, my emacs init file init.el reads thus:

(load "c:/program files/xemacs/xemacs-packages/lisp/ess/ess-site")
(setq comint-scroll-to-bottom-on-output t)
(setq ess-ask-for-ess-directory nil)
(setq ess-pre-run-hook '((lambda () (setq S-directory
  default-directory))))
(setq ess-source-directory (expand-file-name "~/temp/"))
(global-set-key [(shift return)] 'ess-eval-paragraph)



More information about the ESS-help mailing list