Easy to install ESS under Windows

David Winsemius dwinsemius at comcast.net
Mon Apr 19 06:00:47 CEST 2004


Monday, April 19, 2004, 6:00:33 AM, Paul Johnson wrote:

>> My students don't understand very much about Windows, even though they
>> fiercely insist on using it.  It totally baffles me.  Some kept coming
>> back to me says "we can't make Xemacs work" or "we can't make ESS work
>> in Emacs" and I sat down with a Windows system to try to figure it out.

Perhaps I'm an atypical student. I may be an old guy with tired
neurons but I have used CP/M, MS-DOS, skipped Windows 1 and 2, and
began using 3.1, then 3.5, 95, and 98. Recently I upgraded to XP Pro.
I modified my registry before it became commonplace. I have used CLI
OSes in various forms over the years.

I cannot get Xemacs to work. So I went through your instructions to
see if they were bullet-proof and although they promise to be very
helpful, I don't think they are detailed enough to work for the level
of student arm-holding you desire.

I am going to go through this process and annotate a newbie
experience. I do not have a fresh machine because I have installed
Xemacs before. I never got it running, despite quite a bit of
searching and effort. *.el files show up as Xemacs type, but I should
be able to fix that.

>>
>> I agreed with them that Xemacs installation is too slow to be
>> feasible. We did find a startup program, but the ftp servers were so
>> impossibly slow that I gave up.
>>
>> I prefer Emacs anyway, so I checked into that.
>>
>> 4 years ago, back when I did use windows sometimes, I remember that
>> someone--was it Richard Heiberger??--had written the simplest possible
>> install instruction.  But I can't find that now on the net.
>>
>> I think that the ESS guide here is pretty good:
>>
>> http://www.analytics.washington.edu/downloads/ess/doc/html/ess_2.html#SEC9
>>
>> but we did not tumble on to this until pretty late in the advanture.
>>
>> So I made some "idiot proof" install instructions.  In particular, I
>> want to avoid telling people to edit or create ".emacs" and instead of
>> telling them "install wherever you want," I'm telling them exactly
>> where to put it, so there's not ambiguity.
>>
>> --------------------------------------
>>
>> In case you want to install Emacs on a personal computer, here's what
>> you do.  This is not the most elegant strategy, but it does work on
>> the Windows 2000 and Windows XP systems that I have used.
>>
>> Get this file:
>>
>> emacs-21.3-fullbin-i386.tar.gz
>>
>> I found copies on many of the ftp mirrors, including:
>>
>> ftp://cudlug.cudenver.edu/pub/mirrors/ftp.gnu.org/gnu/emacs/windows/
>>
>> I do not know if the version of the file called
>> emacs-21.3a-fullbin-i386.tar.gz
>>
>> is better or worse. I suspect it is better.
>>
>> make a directory
>>
>> c:\ProgramFiles
>>
>> Note: no space.

Hmmmm,  confusingly named like a standard folder for Windows.
>>
>> open the tarball (using winzip or any other tar-equipt compression
>> program you want), you dump the emacs-21.3-fullbin-i386.tar.gz it into
>> c:\ProgramFiles.
>>
OK, the Classic version of WinZip works.
>> It creates a directory so you see
>>
>> c:\ProgramFiles\emacs-21.3.
>>
>> Look inside there for subdirectories
>>
>> bin : "binary", meaning programs.  There you see "runemacs.exe" which
>> is the thing you would double click on.  You can create desktop
>> shortcuts in the usual way if you want.

A typical way to add a program to the GUI is to drag the program icon
to the Start menu. When you do this in an XP box it shows up as a
folder named Gnu Emacs. I mention this because looking for RunEmacs or
Emacs produced momnetary confusion.
>>
>> lisp:  a collection of files in lisp format that supply addon capability
>>
>> site-lisp:  an empty place where you can install things like ESS
>>
>>
>> In the Windows Explorer, go into the bin directory, double click the
>> "addpm" program. That makes a little registry change in your
>> system. It adds an Emacs start menu iterm. I always go move the icon
>> for emacs into the Editor group and delete the GNU Emacs group. You
>> don't have to.

Oh, I see I had anticipated this step. It does not assign *.el files
to open with emacs, nor does it make Windows "aware" of emacs as a
legitimate program so that one can assign .el files to it.
>>
>>
>> Now, go get a version of ESS. I would install this one:
>>
>> ess-5.1.24.tar.gz
>>
>> Untar it into the site-lisp directory.
>>
>> It will create its own directory, so it should be
>>
>> C:\ProgramFiles\emacs-21.3\site-lisp\ess-5.1.24

You do need to to coerce Windows into doing anything with README. I
suppose that an experienced Windows user will be able to force the OS
to open the readme, but that is a potential failure mode. By default
in Windows, that file name "README" will not show up in any dialog box
that is opened or by double-clicking on it.

If you want to force Windows to change or create a new filetype, you
need to have a folder window open in the Windows Explorer (or at least
that what MS used to call it.) Choose Tools/Folder Options/File
Types<tab>/ On my system if you scroll down to EL you can highlight it
with a click and click the "Change button". You then need to "browse"
to the executable that you want to associate with it. I picked
emacs.exe, but it is possible that I should have picked runemacs.exe.

>>
>> THen create a file called "site-start.el" and in the site-lisp
>> directory. You need only one line:
>>
>> (load
>> "c:/ProgramFiles/emacs-21.3/site-lisp/ess-5.1.24/lisp/ess-site.el")
>>
OK, coaxed Notepad to make such a file.
>> (that's all on one line). Note, if you change directories or such,
>> then you have to fix that. Store that file in
>> c:\ProgramFiles\emacs-21.3\site-lisp.
>>
>> Its such a small file I attached it to this email.
>>
>> (I choose to put this in site-start.el because then ESS will work for
>> all users, not just the ones who are smart enough to find directions
>> that explain how to put the same element into the user .emacs file.)

Which can be a real hurdle as I describe below.
>>
>> That should get the job done.  If your R is working and if the R/bin
>> directory is in your path, then Emacs will be able to find it.  So
>> open a file with the extension R, then type
>>
>> M-x  R
It doesn't work. Is it case sensitve? Could it have something to do
with the fact that my installation of the R executable is in:
"C:\Program Files\R\rw1081\bin\"  but is not named "R" but rather RGui?
I do have a functional R installation. Rcmd.exe is also there.
>>
>> (M is for "meta", which may be the ALT key on your system)
>>
>> If R does not start inside Emacs shell, then it means your R is
>> installed incorrectly/incompletely. Most likely, you need to add the
>> directory that holds R/bin into your search PATH.  In Windows2000 or
>> XP, that's a setting you can change in the control
>> panel/system/environment.

On XP Pro, Win2000, (and I suspect XP) make that:
             Control Panel/System/Advanced<tab>/
             Environment Variables<button>:
             System Variables/<select>Path/Edit<button>
And the item to add to the path on my machine is:
C:\Progra~1\R\rw1081\bin
Unless your students have their R installation at the root it will
need to be the full path to the executable. I tested it by entering
"Rgui" in the "Run" window and R opened up fine.

>> In Win 95/98, you can put a line in your
>> autoexec bat that adds the R/bin to your PATH.  I could look up that
>> syntax for you, but don't want to encourage you to use those systems.
>>
>>
>> Honestly, I don't know why it seems so complicated to install Emacs
>> and ESS when you look around the internet.  Maybe I'm not helping by
>> adding one more voice in the mess.  It must be true that there are
>> many many ways to do it.

I looked. I tried. I stumbled. It's not easy.

It might be because the dependencies are not specified in clear
detail in any of the easily found HOW-TO's. I consider myself fairly
knowledgeable as an end user and I have failed on several occasions.
I suspect that the *nix users make assumptions about where stuff is
supposed to be but do not articulate it in the directions.

Even the task of creating a .emacs file or a .xemacs folder can be a
major stumbling block because it is not obvious how to create a file
named ".emacs" in Windows. The file browser will not allow you to
create that file name.
>>
>>
>> This way works, I've seen it with both eyes on 2 windows computers.
>>
I think this is a good start, but I still see easy failure modes and
there are obviously failure modes that I cannot see, since I still
cannot launch R from within emacs.

-- 
Best regards,
 David                            mailto:dwinsemius at comcast.net




More information about the ESS-help mailing list