[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
(http://list.cs.brown.edu/pipermail/plt-scheme/2003-November/003965.html)
I mentioned that I use an info version of the r5rs
spec for context-sensitive help on key words. In
another post
(http://list.cs.brown.edu/pipermail/plt-scheme/2003-November/004068.html),
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:

http://home.comcast.net/~bc19191/2003_11_30_bill-clementson_archive.html#107073853608742095

It performs a Scheme evaluation based on the following
criteria:

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
s-expression
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.
http://photos.yahoo.com/


Posted on the users mailing list.