Skip to content

Instantly share code, notes, and snippets.

@zendeavor
Created September 5, 2013 13:02
Show Gist options
  • Save zendeavor/6449797 to your computer and use it in GitHub Desktop.
Save zendeavor/6449797 to your computer and use it in GitHub Desktop.
powertools markdown for iosdp

Students who have more advanced knowledge of computers and programming may be interested in more powerful ways to interact with racket programs.

Here are some options

As this thread presupposes an existing competence level (because you're advanced users), I will not be covering installation instructions. Emacs is available on Windows, Mac OSX, and Linux.

Please provide your own awesome tips and tricks to add to this thread!

I've just switched to Emacs myself, and I'm absolutely loving it. I was a long-time Vim user, but the migration to Emacs was surprisingly simple. In just 5 minutes, I was able to get Emacs running with a Racket frame directly below my script!

Here's how I did it

Emacs setup

  1. Install Emacs24.
    • For Linux, just install it with your package manager.
    • For Mac OSX, you may want to try homebrew.
  2. Create a directory in your user's home called .emacs.d
    • For Linux, mkdir ~/.emacs.d.
  3. Launch Emacs.
  4. Type C-x C-f ~/.emacs.d/init.el RET
  • You might be asked to Confirm this if the file does not yet exist. Hit RET.
  1. Add the following to the buffer.

     ;; Marmalade repository
     (add-to-list 'package-archives
          '("marmalade" . "http://marmalade-repo.org/packages/") t)
    
  2. Type M-x package-initialize RET

  3. With your cursor on the last closing parenthesis, type C-x C-e

  • You should see the following text in the echo area at the bottom of your Emacs window.
  • (("marmalade" "http://marmalade-repo.org/packages/"))
  1. Type M-x package-install RET geiser RET
  • This should download the geiser package and all its dependencies.
  • If you don't like the frame that popped up, type C-x 1
  • If you are not in the buffer containing your init.el file, use C-x b to get it back.
  1. Add the following to the buffer containing your init.el file.

     ;; geiser with gracket
     (setq geiser-active-implementations '(racket)
           geiser-racket-use-gracket-p t)
    
  2. Eval that with C-x C-e like in step 7.

  3. Use C-x C-f to open or create a racket script (a file ending in .rkt).

  • Use M-x run-geiser to launch a racket shell in a split buffer.

NOTES

Emacs Tips
  • RET means the return or enter key
  • C-key means to hold ctrl, and press key, then release both
  • M-key means to hold alt, and press key, then release both
  • Remember to use C-x b to switch to different buffers and files
  • Try C-x C-b to get a list of open buffers
  • C-n and C-p scroll the cursor down and up, respectively
  • C-f and C-b move the cursor forward and backward, respectively.
  • M-f and M-b move the cursor forward and backward, respectively, in larger steps.
  • Remember to use C-x C-f to open (and even create) new files
  • Use M-x make-directory if you created a file with C-x C-f in a nonexistant directory (folder in Windows)
  • Save your files! C-x s and C-x C-s
  • If geiser failed to launch your racket then look here
  • My .emacs.d

Please feel free to ask questions and note mistakes in my post. And please share your own awesome tips for setting up a sweet development environment with other tools!

Other Resources

Some nice resources for learning about Emacs

Video series and tutorials

Blogs and other text-based materials

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment