[plt-scheme] Paren Paralysis Sufferers Unite

From: Synx (plt at synx.us.to)
Date: Thu Oct 29 16:17:02 EDT 2009

> 1) Unless your e-mailer messed it up, you're not letting drscheme indent
> your code.  Here's what it looks like, indented:

I indented my own code, but it is relatively the same as yours, just you
inserted 4 spaces instead of 2 to offset the second 'if' and 'let'
expressions. I forgot how drscheme adds extra space to line up the other
arguments with the first.

I do use the lining up of arguments vertically to help find the context
sometimes. But like I said when I am faced with ))))))))) it's hard for
me to tell that I have to hit enter "))))))here)))" to get the
indentation (and lexical context) that I want. When the indentation
already exists it's relatively easy to understand, but when I just have
a blob of close parens, I have to delete them one at a time until
drscheme highlights to the expression I want, otherwise I'll never know
when to hit enter.

In that sense I like that one lisp paste website, where it highlights
matching parens simply by hovering your mouse over it. (or cursor would
be fine too). I don't think that's implemented in drscheme though.

I really don't have that much trouble with parentheses. It's just a
little tricky. I certainly don't think the solution is to go the XML way
and have (procedure argument argument argument /procedure)!

...maybe if /procedure) was treated as a comment, but... NO BAD

> 2) Use the s-expression navigation keys!

THANK you. I've been trying to get something like this working for a while!

When I hold Alt, right and left go from argument to argument in the
current s-exp, up goes into the context of that expression being an
argument of something else, and down goes into the current argument as
if it were an expression. That's very intuitive!

> Going
> whole hog, you can remap your left-paren to perform this operation, and
> you can get rid of the 'ESC'.

I like how emacs can do this (though not so much how they block what is
seen as improper deletion). How do I remap keys in drscheme? All I've
been able to do so far is show the keybindings, but not change any of them.


Posted on the users mailing list.