Setting up Emacs for PLT Scheme
Saturday, January 17, 2004
I've created a page called "
Setting up Emacs for use with PLT Scheme on
Windows or Mac OS X". It's a step-by-step set of instructions on how
to download, install and configure Emacs, PLT Scheme and some utilities that
make developing with PLT Scheme easier. It is similar to the page
that I created for the
CL Cookbook on
setting up Emacs for use as a
CL IDE; however, this page focuses solely on
Note: The Mac OS X content is a bit "basic" ;-) as I don't use OS X on a regular basis. It really needs a lot of work. I would appreciate any feedback that would help improve the Mac OS X section of the document.
The main features of the resulting setup are:
- Utilizes Quack.
- Provides Scheme macro expansion functionality (using code originally written by Eli Barzilay).
- Provides Scheme trace functionality (using code originally written by Daniel Silva).
- Provides context sensitive access to R5RS document using Info
- Optional utility downloads provide for:
- Easier syntax colorization
- CUA-like key bindings to make it easier for Windows users to use Emacs
- Muliple view windows within Emacs for directories, files, functions/variables, etc. using Emacs Code Browser (ECB).
- Many "convenience" defaults that aren't normally "on" in Emacs.
- Programming - Scheme: Scheme-specific setup. The following Scheme-specific bindings have been added:
- F5 - Starts MzScheme.
- C-c Enter - Selects the s-expression at the cursor location for macroexpansion.
- C-c e - Fully expands the selected s-expression.
- C-c o - Expands the selected s-expression once.
- C-c * - Expands the selected s-expression repeatedly.
- C-c h - Shows the s-expression that will be acted on.
- F1 - Brings up the R5RS Info documentation for the symbol that the cursor is on (if the documentation was installed).
- C-c x - Evaluates the current region or s-expression (works in Scheme or Info mode).
- C-c ; - Inserts "balanced" comments around the current s-expression (a prefix argument moves the comment out).
- C-c : - Removes "balanced" comment.
- C-c t - Trace the function at the cursor location (a prefix argument un-traces the function).
- C-c T - Trace all functions in the current namespace (a prefix argument un-traces all functions).
- Standard Key Overrides: Some convenience key setups. The
following key bindings have been added:
- mouse-2 - Brings up a menu of symbols when in a Scheme/Elisp source file.
- F4 - Closes current buffer window.
- F6 - Switches focus to another window (when multiple windows are in an Emacs frame).
- F7 - Closes all windows except for the window that currently has focus.
- C-F7 - If ECB was loaded, toggles between multiple ECB windows and just a single source window.
- M-F7 - If ECB was loaded, toggles between different ECB window layouts.
- F12 - Emacs shell
- C-F12 - Default shell
- M-F12 - Bash shell (if present on computer)
- C-c f - Finds the Emacs Lisp function at the cursor location.
- C-c F - Finds the file whose name is at the cursor location.
- C-c j - Joins current line with previous line.
- C-c s - Search forward using the symbol that is currently under the cursor.
- C-c r - Search backward using the symbol that is currently under the cursor.
- C-c / - Do a word completion (using hippie-expand).
- C-c g - Goto a line (prompts for line#).
- C-c a - Select the entire buffer contents.
- MS Windows Customizations: These settings make Emacs feel more
like a Windows application. For Windows machines, they add the following
- In dired mode, when you press the "w" key when the cursor is on a file name, the file will be opened with the default application for that file type.
- When cua-emul.el is installed:
- M-F4 - Close frame (closes Emacs if only one Emacs frame is open).
- C-F4 - Close the current buffer.
- C-TAB - Switch to next buffer.
- C-S-TAB - Switch to previous buffer.
- Mac OS X Customizations: Mac OS X specific customizations:
- Keypad DEL - Deletes character under cursor.
- C-kp-HOME - Goes to beginning of buffer.
- C-kp-END - Goes to end of buffer.
- Start Directory: After Emacs starts up, the start directory will be the HOME directory.
- Customizations: Some customizations that can be overridden using
the "Customize Emacs" menu option (on the Options menu).
- Use CUA key bindings:
- C-c - Standard Windows copy.
- C-x - Standard Windows cut.
- C-v - Standard Windows paste.
- C-z - Standard Windows undo.
- Use Greek lambda characters to represent "lambda".
- Disable tool bar.
- Some colorization customizations for Quack.
- Use CUA key bindings: