[plt-scheme] Useful Emacs code when working with PLT Scheme

From: Bill Clementson (bill_clementson at yahoo.com)
Date: Sat Dec 6 15:09:48 EST 2003

I would be interested in seeing any snippets of code
that people find useful when working with PLT Scheme
in Emacs. In an earlier post
I mentioned that I use an info version of the r5rs
spec for context-sensitive help on key words. In
another post
I submitted some code for doing macro-expansion. Other
people have mentioned Neil van Dyke's quack.el (which
I use as well). 

Well, to kick things off, I'd like to share the
following code snippet from my weblog:


It performs a Scheme evaluation based on the following

1. If a region has been selected, evaluate the region
2. If the cursor is positioned on or directly after a
closing parens, evaluate the preceeding s-expression
3. If the cursor is positioned on or directly before
an openning parens, evaluate the following
4. Otherwise, evaluate the top level s-expression that
the cursor is located inside of

I bind it to 'C-c x' in scheme-mode and in Info-mode.
I bind it to the same key in Info mode because I often
find it useful to be able to evaluate Scheme code from
within an info document (e.g. -- Info versions of
SICP, R5RS, etc.). If you use a prefix argument (e.g.
-- you press "C-u C-c x" instead of just "C-c x"),
focus is also changed to the *scheme* buffer.  

Bill Clementson

Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.

Posted on the users mailing list.