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

Ponting, Keith (Keith) kponting at avaya.com
Wed Sep 19 10:19:42 CEST 2012


Hi Paul,

Another not what you want, but here goes. I get similar but not identical behaviour - (Vista, emacs 24.1.1 from Vincent Goulet's excellent bundle emacs-24.1-modified-1, including ESS 12.04-4). If I <ctrl>C <ctrl>C with the cursor in the *R* buffer on the line which says "--- Please select a C RAN mirror for use in this session ---", then the minibuffer responds "no command on this line", but if I move the cursor up to a command prompt line (beginning "> "), then the interrupt works. 

More like what you want: I have the following in my .emacs - you could try something like this in site-start.el with your solutions 1 or 2 replacing my max.print option:

(defun my-ess-post-run-hook ()
  (ess-execute-screen-options) ; from ESS-help Digest vol 77 issue 10
  (local-set-key "\C-cw" 'ess-execute-screen-options)
  (if (string= ess-dialect "R") (ess-eval-linewise "options(max.print=100)" nil nil nil (quote wait)))
)
(add-hook 'ess-post-run-hook 'my-ess-post-run-hook)

HTH,

Keith Ponting
Aurix Ltd, Malvern WR14 3SZ  UK
Any opinions are those of the author not the company.

> -----Original Message-----
> From: ess-help-bounces at r-project.org [mailto:ess-help-bounces at r-
> project.org] On Behalf Of Joshua Wiley
> Sent: 19 September 2012 06:20
> To: Paul Johnson
> Cc: ess-help
> Subject: Re: [ESS] Windows Emacs: still hangs on install.packages(); no
> fix?
> 
> Hi Paul,
> 
> Probably not really what you want but note that:
> 
> require(tcltk)
> 
> before running will also fix it.  If you have access to global emacs
> files, perhaps a system R profile?  I'm not sure of a pure ESS approach,
> but maybe other smarter folks will chime in.
> 
> Cheers,
> 
> Josh
> 
> On Tue, Sep 18, 2012 at 9:45 PM, Paul Johnson <pauljohn32 at gmail.com>
> wrote:
> > Greetings ESS developers:
> >
> > After my impassioned plea in favor of Emacs and ESS
> > (http://pj.freefaculty.org/guides/Rcourse/emacs-ess/emacs-ess.pdf),
> > 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.
> >
> > https://stat.ethz.ch/pipermail/ess-help/2008-January/004470.html
> >
> > 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
> > time.
> >
> > 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"
> >         options(repos=r)})
> >
> > 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
> > insane.
> >
> > 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
> >
> > ______________________________________________
> > ESS-help at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/ess-help
> 
> 
> 
> --
> Joshua Wiley
> Ph.D. Student, Health Psychology
> Programmer Analyst II, Statistical Consulting Group University of
> California, Los Angeles https://joshuawiley.com/
> 
> ______________________________________________
> ESS-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help



More information about the ESS-help mailing list