Friday 11 April 2014

Emacs: Racket on Windows

As a continuation from my last post, I also want to show how to install Racket on Emacs for Windows.

I'm going to show the easiest way (that I know of).  So, this will not install the most recent version of Emacs, but will be the quickest and easiest way possible.

In order to install Emacs, I'm going to use Chocolatey.  Chocolatey is the budding Windows package manager based on NuGet.

So here we go!

Chocolatey (Powershell Install):
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin

Emacs (super text editor):
cinst emacs

Geiser (Racket support for emacs):

  • Find your .emacs file
    • Open emacs and find .emacs file by using:
      • C-x C-f ~/.emacs  (~/ is the current home directory)
  • Add package archive configuration to .emacs
    • Add this to the .emacs file:
      (require 'package)
      (add-to-list 'package-archives
        '("marmalade" . "http://marmalade-repo.org/packages/"))
      ;; You don't need this one if you prefer marmalade and released versions:
      ;; (add-to-list 'package-archives
      ;;  '("melpa" . "http://melpa.milkbox.net/packages/"))
      (package-initialize)
  • Install the package
    • Open emacs
      • M-x package-install RET geiser RET (RET is press <enter>)
You should now be able to run Racket mode by opening emacs and doing the following:

M-x run-geiser
> Start Geiser for scheme implementation: racket

This should start the REPL.