I assume Chaitin's constant is involved.<br><br><div class="gmail_quote">On Fri, May 11, 2012 at 3:22 PM, Matthias Felleisen <span dir="ltr"><<a href="mailto:matthias@ccs.neu.edu" target="_blank">matthias@ccs.neu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
[How] does Xcode allow you to enter arbitrary computations in response to key events? I don't understand how one can list "all possible actions" since there are infinitely many? -- Matthias<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
On May 11, 2012, at 2:58 PM, Nick Shelley wrote:<br>
<br>
> On the topic of key bindings, is there a reason this can't be done in the preferences menu? Xcode has a key bindings section in the preferences menu that has all possible actions on the left and the current bindings on the right, and you can just click on the current binding and change it to whatever you want. I think something like that would be nice in DrRacket, but I have no idea how hard it would be to implement.<br>
><br>
> Maybe that's on the list of "It would be nice, but..."<br>
><br>
> On Fri, May 11, 2012 at 6:14 AM, Robby Findler <<a href="mailto:robby@eecs.northwestern.edu">robby@eecs.northwestern.edu</a>> wrote:<br>
> Ah, good point. I've added some example code to the docs that shows<br>
> how to bind menu items. Here's the code.<br>
><br>
> Robby<br>
><br>
> #lang s-exp framework/keybinding-lang<br>
><br>
> (define (menu-bind key menu-item)<br>
> (keybinding<br>
> key<br>
> (ë (ed evt)<br>
> (define canvas (send ed get-canvas))<br>
> (when canvas<br>
> (define menu-bar (find-menu-bar canvas))<br>
> (when menu-bar<br>
> (define item (find-item menu-bar menu-item))<br>
> (when item<br>
> (define evt<br>
> (new control-event%<br>
> [event-type 'menu]<br>
> [time-stamp<br>
> (send evt get-time-stamp)]))<br>
> (send item command evt)))))))<br>
><br>
> (define/contract (find-menu-bar c)<br>
> (-> (is-a?/c area<%>) (or/c #f (is-a?/c menu-bar%)))<br>
> (let loop ([c c])<br>
> (cond<br>
> [(is-a? c frame%) (send c get-menu-bar)]<br>
> [(is-a? c area<%>) (loop (send c get-parent))]<br>
> [else #f])))<br>
><br>
> (define/contract (find-item menu-bar label)<br>
> (-> (is-a?/c menu-bar%)<br>
> string?<br>
> (or/c (is-a?/c selectable-menu-item<%>) #f))<br>
> (let loop ([o menu-bar])<br>
> (cond<br>
> [(is-a? o selectable-menu-item<%>)<br>
> (and (equal? (send o get-plain-label) label)<br>
> o)]<br>
> [(is-a? o menu-item-container<%>)<br>
> (for/or ([i (in-list (send o get-items))])<br>
> (loop i))]<br>
> [else #f])))<br>
><br>
> (menu-bind "c:a" "Run")<br>
><br>
><br>
> On Thu, May 10, 2012 at 8:22 PM, Ray Racine <<a href="mailto:ray.racine@gmail.com">ray.racine@gmail.com</a>> wrote:<br>
> > I'm caught in a bit of Catch-22. From the doc.<br>
> ><br>
> > If you are most familiar with Emacs-style key bindings (especially on<br>
> > windows or some linux installations where the control key is, by default,<br>
> > for the menu shortcuts), you should uncheck the Enable keybindings in<br>
> > menus preference. Many of the keybindings below are inspired by Emacs.<br>
> ><br>
> > So I've disabled keybindings in menu and thereby lose crtl-r Run and crtl-i<br>
> > Reindent. I'd like to re-bind but I've as of yet been unable to locate what<br>
> > functions Run and Reindent correspond to.<br>
> ><br>
> > I totally missed the online check syntax option, which sounds like a very<br>
> > good thing. In fact I'm still totally missing it. :) I just rechecked the<br>
> > menus/preferences. Where is this mythic option found?<br>
> ><br>
> > Thanks<br>
> ><br>
> ><br>
> > On Thu, May 10, 2012 at 8:49 PM, Robby Findler <<a href="mailto:robby@eecs.northwestern.edu">robby@eecs.northwestern.edu</a>><br>
> > wrote:<br>
> >><br>
> >> FWIW, run and reindent are already menu-key based shortcuts (r and i<br>
> >> respectively) so they should be available already (unless you're on<br>
> >> windows and you've disabled menu keyboard shortcuts). For reindent you<br>
> >> can hit tab, and DrRacket re-indents the line you're on or the<br>
> >> selection (if it is more than one line). For check syntax, I recommend<br>
> >> you enable online check syntax and then you don't have to hit any key<br>
> >> at all to get that to work.<br>
> >><br>
> >> hth,<br>
> >> Robby<br>
> >><br>
> >> On Thu, May 10, 2012 at 6:38 PM, Ray Racine <<a href="mailto:ray.racine@gmail.com">ray.racine@gmail.com</a>> wrote:<br>
> >> > I'm attempting this weekend to make the leap from my beloved Emacs and<br>
> >> > Geiser to DrRacket. Was wondering if anyone has a cool set of custom<br>
> >> > keybindings they'd like to share.<br>
> >> ><br>
> >> > Some I'd like to get my hands on are:<br>
> >> > 1. binding for reindent / reindent all.<br>
> >> > 2. binding for Check Syntax button equivalent.<br>
> >> > 3. binding for Run button equivalent.<br>
> >> ><br>
> >> > Three below I just pieced together.<br>
> >> ><br>
> >> > ;; insert ë<br>
> >> > (keybinding "c:\\" (ë (editor evt) (send editor insert "ë")))<br>
> >> ><br>
> >> > ;; close<br>
> >> > (keybinding "c:q" (ë (editor evt)<br>
> >> > (send (send editor get-top-level-window)<br>
> >> > close-current-tab)))<br>
> >> ><br>
> >> > ;; open a new tab<br>
> >> > (keybinding "c:t" (ë (editor evt) (send (send editor<br>
> >> > get-top-level-window)<br>
> >> > create-new-tab))<br>
> >> ><br>
> >> > ____________________<br>
> >> > Racket Users list:<br>
> >> > <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
> >> ><br>
> ><br>
> ><br>
><br>
> ____________________<br>
> Racket Users list:<br>
> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
><br>
> ____________________<br>
> Racket Users list:<br>
> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br>
<br>
____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</div></div></blockquote></div><br>