[plt-scheme] Overriding insert-lambda-template keybinding?

From: Robby Findler (robby at cs.uchicago.edu)
Date: Wed Feb 20 16:03:06 EST 2008

Looks like the code was wrong (or maybe I just misremembered). In any
case, the current SVN version now uses the name of the function, if
the function has a name.

Robby

On Tue, Feb 19, 2008 at 2:59 PM, Grant Rettke <grettke at acm.org> wrote:
> On Feb 19, 2008 8:13 AM, Robby Findler <robby at cs.uchicago.edu> wrote:
>  > Did you write something like this:
>  >
>  >  (define (my-func text event) ...)
>  >  (keybinding "ESC;s:l" my-func)
>
>  Yes. I pasted it below. Maybe I am obviously doing something very wrong...?
>
>  ; $LastChangedDate: 2008-02-19 14:57:46 -0600 (Tue, 19 Feb 2008) $
>  ; $LastChangedRevision: 1364 $
>  ; $HeadURL: svn://osiris/drscheme/trunk/mykeys.ss $
>
> (module mykeys (lib "keybinding-lang.ss" "framework")
>
>   ; Use the word lambda rather than the lambda symbol
>   ; Source code
>   ;  Url: http://svn.plt-scheme.org/plt/tags/v372/collects/framework/private/keymap.ss
>   ;  Lines: 375-385 (insert-lambda-template)
>   (define insert-lambda-template
>
>     (lambda (edit event)
>       (send edit begin-edit-sequence)
>       (let ([selection-start (send edit get-start-position)])
>         (send edit set-position (send edit get-end-position))
>         (send edit insert ")")
>         (send edit set-position selection-start)
>         (send edit insert ") ")
>         (send edit set-position selection-start)
>         (send edit insert "(lambda ("))
>       (send edit end-edit-sequence)))
>
>   (keybinding "ESC;s:l" insert-lambda-template))
>


Posted on the users mailing list.