[plt-scheme] URL rewrite/dispatch in PLT Web server

From: Ethan Herdrick (info at reatlas.com)
Date: Sat Mar 24 18:20:45 EDT 2007

Hi folks:

I'm trying to set a few of my own keybindings, but I'm not running
across any documentation that I.  I realize that the keybinding
function takes as its second argument a lambda that takes an editor
and an event.  But beyond that I'm unsure what the second argument
should be.

The last two lines of the code below are a couple of things I've tried
that don't work.   Actually, the last one 'works' in that it does bind
something to F9, but that 'something' is a string.  Useful, but not
what I'm trying to do right now.  What I want to do is map
put-previous-sexp and put-next-sexp to a couple of keys.  I think
put-previous-sexp is a function, is this so?  It's what is currently
mapped to the ESC-p chord.

(module ethan-keybindings (lib "keybinding-lang.ss" "framework")
  (define (make-handler s)
    (lambda (editor event)
      (send editor insert (make-object string-snip% s))))

  (require (lib "tool-lib.ss" "drscheme"))
  (keybinding "f8" (lambda (editor event) (put-previous-sexp)))
  (keybinding "f9" (make-handler  "put-next-sexp")))

Thanks in advance!

-Ethan


Posted on the users mailing list.