[ESS] trace(edit=TRUE) under MS Windows

Vitalie Spinu spinuvit at gmail.com
Thu Mar 7 10:15:33 CET 2013

Hi Ross, 

It works fine for me on linux. The error message you get is from emacs
not R. You have to start emacs server before able to run emacsclient.

Put this into your .emacs:

   (require 'server)

The following, ESS specific alternative could also be used here.  Press
C-c C-e C-d and choose mice.impute.2L.norm. Edit and eval or source.

For simple cases that should work fine. For more complex situations you
have to source into the package environment/namespace. Activate
ess-developer (C-c C-t C-t) and add a package you want to source into
(C-c C-t C-a). From now on all you eval/load commands should work on
that package environment/namespace instead of .GlobalEnv.


  >> Ross Boylan <ross at biostat.ucsf.edu>
  >> on Wed, 06 Mar 2013 17:41:19 -0800 wrote:

  > I just tried

  >> trace(mice.impute.2L.norm, where=mice, edit=TRUE, print=FALSE)
  > Error in edit(name, file, title, editor) :
  >   unable to run editor 'emacsclient.exe'

  > Emacs 24.2.1, ESS 12.09-1, Windows 7, R 2.15.2.

  > A few observations:
  > I suspect this isn't working because my PATH doesn't include the right
  > directory.  I tried setting the full path, but still had problems:

  >> getOption("editor")
  > [1] "C:\\Program Files\\GNU Emacs 24.2\\bin\\emacsclient.exe"
  >> trace(mice.impute.2L.norm, where=mice, edit=TRUE, print=FALSE)
  > C:\PROGRA~1\GNUEMA~1.2\bin\EMACSC~1.EXE: No socket or alternate editor.  Please use:

  > 	--server-file      (or environment variable EMACS_SERVER_FILE)
  > 	--alternate-editor (or environment variable ALTERNATE_EDITOR)

  > Some of the R functions seem to attempt to hardcode for emacs, but they don't
  > know that emacsclient.exe is emacs.  In particular, .makeTracedFunction()
  > includes this code:

  >         if (is(editor, "character") && !is.na(match(editor, c("emacs",
  >             "xemacs")))) {
  >             file <- tempfile("emacs")
  >             file <- sub("..$", ".R", file)
  >         }
  >         else file <- ""

  > It might be good to adjust either R or ESS for greater compatibility.

  > Finally, the ESS info file says

  > 4.7 Using emacsclient
  > =====================

  > When starting R or S under Unix, ESS sets
  > `options(editor="emacsclient")'.  (Under Microsoft Windows, it will use
  > gnuclient.exe rather than emacsclient, but the same principle applies.)

  > That doesn't seem to be true, at least on my MS Windows machine.  I have no
  > customizations related to this in my .emacs file.

  > Ross Boylan

  > ______________________________________________
  > ESS-help at r-project.org mailing list
  > https://stat.ethz.ch/mailman/listinfo/ess-help

More information about the ESS-help mailing list