[plt-scheme] Paren Paralysis Sufferers Unite

From: John Clements (clements at brinckerhoff.org)
Date: Thu Oct 29 16:48:23 EDT 2009

On Oct 29, 2009, at 1:17 PM, Synx wrote:

>> 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.

You can do better than this; just use the arrow keys rather than  
hitting 'delete'. Same highlighting, no need to type the close parens  

> 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.

For the cursor, that's already there.

>> 2) Use the s-expression navigation keys!
> THANK you. I've been trying to get something like this working for a  
> while!

Don't thank me, thank Robby.

>> 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.

See Edit > Keybindings > Add User-defined Keybindings ...

FWIW, the attached file[*] instates the keybindings I've just  
mentioned. TNX also CLK.

John Clements

[*] actually, it was so short I just pasted it here:

(module jbc-keybindings framework/keybinding-lang

(define (kb binder function)
      (lambda (editor event)
         (send editor get-keymap)
         editor event #t))))

   (kb "~c:s:(" "insert-()-pair")
   (kb "~c:s:{" "insert-{}-pair")
   (kb "~c:s:\"" "insert-\"\"-pair"))

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2484 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20091029/5aad77d2/attachment.p7s>

Posted on the users mailing list.