[racket] User Keybindings

From: Ray Racine (ray.racine at gmail.com)
Date: Mon Jan 7 13:19:03 EST 2013

I have my Racket configured per the "emacs"  section in DrRacket, so
keybindings in menus is unchecked.

"If you are most familiar with Emacs-style key bindings (especially on
windows or some linux installations where the control key is, by default,
for the menu shortcuts), you should uncheck the Enable keybindings in menus
 preference."

If I define and register my own keybindings.rkt file, bindings and rebinds
work but they appear to wipe out any existing keybindings.

Examples below based on the Racket Doc on keybindings.

;; OK
;;insert λ
(keybinding "c:\\" (λ (editor evt)
                     (send editor insert "λ")))

(define (rebind key command)
  (keybinding
   key
   (λ (ed evt)
     (send (send ed get-keymap) call-function
           command ed evt #t))))

;;OK
(rebind "c:w" "backward-kill-word")

;; OK
(keybinding "c:c;c:t" (λ (editor evt) (send (send editor
get-top-level-window) create-new-tab)))

;; Now Broken
"c:c;c:c" ;; check syntax is broken.


Similarly, if I attempt to bind anything into "c:x;?:?" things break,
though the freshly added binding works.

;; works
(keybinding "c:x;c:t" (λ (editor evt) (send (send editor
get-top-level-window) create-new-tab)))

;; Now BROKEN
"c:x;c:f" ;; the open file dialog

;; Now BROKEN
"c:x;c:s" ;; save definitions (file)

Roughly, it appears in lieu of extending the keymap with a new (re)binding,
the new binding is added into a fresh keymap and the existing default
keymap is shadowed, flushed, or ignored.  They still show up on the menu
listing "Show Active Keybindings" just no workee any more.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130107/d38d46d1/attachment.html>

Posted on the users mailing list.