[ESS] Windows Emacs: still hangs on install.packages(); no fix?

Paul Johnson pauljohn32 at gmail.com
Wed Sep 19 06:45:48 CEST 2012

Greetings ESS developers:

After my impassioned plea in favor of Emacs and ESS
a few of the students relented and tried it out. It is mostly working
as I expect, but a widespread problem has developed. The ESS session
hangs if the user runs commands that need CRAN access. A command like

> install.packages("lmtest")

hangs the session.  The ESS buffer says choose CRAN repository from
list, but the list never pops up. Is this a tcltk problem? (In Linux,
the CRAN chooser is a tcltk thing, I wonder if Windows uses same).

I've found a few posts about this problem, which proposes some
workarounds, but none are great.


That one says that C-c C-c will break the freeze, but it does not do
that in Emacs 24.1 or 24.2 for Windows. For me, Emacs stays frozen,
the minibuffer says "Text is read only".

I wish this problem could be fixed on your end, but in lieu of that, I
need a "solution" that I can engineer for all users on a system,
something to put in site-start.d. When I go from one machine to
another, I can't remember to re-run these workarounds every single

Here are the workarounds that do work, but they aren't great.

1. Remember to run this every time you start R in ESS:

> chooseCRANmirror(graphics = FALSE)

That gives a text chooser for the desired CRAN mirror. That's fine.

It is hard to remember to do that every time.

2. In  ~/.Rprofile file, put such:

local({r <- getOption("repos")
        r["CRAN"] <- "http://rweb.quant.ku.edu/cran"

The only problem there is that you have to re-do that when you go to a
new computer or run in a different user account.  It is driving me

Is there something I can put in the Emacs startup file system-wide
that forces all CRAN chooser things to obey the graphics=FALSE policy?
In the old days, Emacs for Windows had the problem that the file
chooser menu could not let the user choose a file.  TO address that, I
put this in init.el:

(if (eq system-type 'windows-nt)
    (setq use-file-dialog nil))

If there were something I could put in there to tell ESS to NOT try to
open the CRAN mirror chooser, I could be happy.

Paul E. Johnson
Professor, Political Science    Assoc. Director
1541 Lilac Lane, Room 504     Center for Research Methods
University of Kansas               University of Kansas
http://pj.freefaculty.org            http://quant.ku.edu

More information about the ESS-help mailing list