Make the example `rebind' more like other rebinds in Emacs and others.

This commit is contained in:
Eli Barzilay 2011-10-17 11:08:23 -04:00
parent df4a227571
commit 6a323fe75e

View File

@ -239,13 +239,13 @@ name with the new keystroke you want, like this:
@racketmod[
s-exp framework/keybinding-lang
(define (rebind name new)
(keybinding
new
(lambda (ed evt)
(send (send ed get-keymap) call-function name ed evt #t))))
(define (rebind key command)
(keybinding
key
(λ (ed evt)
(send (send ed get-keymap) call-function command ed evt #t))))
(rebind "backward-kill-word" "c:w")
(rebind "c:w" "backward-kill-word")
]
Note that DrRacket does not reload keybindings files automatically when you