[plt-scheme] How to remap keybinding "(c:j)" from "newline" to "newline-and-indent"?

From: Anthony Cowley (acowley at seas.upenn.edu)
Date: Wed Apr 1 13:34:03 EDT 2009

> Based on the information in the blog, I constructed the following
> mykeys.ss file:
>
> --
> (module mykeys
> (lib "keybinding-lang.ss" "framework")
>
> ; Adds DrScheme Specific functions to the
> ; available functions we can bind to.
> (require (lib "tool-lib.ss" "drscheme"))
>
> (keybinding "c:j"
> (lambda (editor event)
>  (begin
>    (newline)
>    (tabify-at-caret)))))
> --

Does this do what you want?

(keybinding "c:j" (lambda (editor event)
                    (send editor insert #\newline)
                    (send
                        (send editor get-keymap)
                        call-function
                        "tabify-at-caret"
                        editor event #t)))

Anthony


Posted on the users mailing list.