Is the '<span class="Apple-style-span" style>Script Plugin' an option for keybindings?</span><div><br></div><div>S.</div><div><br></div><span></span><div><span class="Apple-style-span" style>The Script Plugin for DrRacket may help to create simple plugins, like automatic text (or snip%s) insertion, text selection replacement (and much more), without needing to restart DrRacket :<br>
<a href="http://planet.plt-scheme.org/display.ss?package=script-plugin.plt&owner=orseau" target="_blank" style="text-decoration:none">http://planet.plt-scheme.org/display.ss?package=script-plugin.plt&owner=orseau</a><br>
Docs:<br><a href="http://planet.plt-scheme.org/package-source/orseau/script-plugin.plt/2/0/planet-docs/manual/index.html" target="_blank" style="text-decoration:none">http://planet.plt-scheme.org/package-source/orseau/script-plugin.plt/2/0/planet-docs/manual/index.html</a></span><br dir="ltr">
<br>On Friday, May 11, 2012, Nick Shelley wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">So no, it does not allow you to enter arbitrary computations. I'm not saying that this should replace the current language-based approach, but I think that having this for all pre-defined actions (like new tab, run, complete, etc.) would make customizing (as apposed to augmenting) much more convenient.<br>
<br><div>On Fri, May 11, 2012 at 1:39 PM, Nick Shelley <span dir="ltr"><<a>nickmshelley@gmail.com</a>></span> wrote:<br><blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Sorry to be imprecise. It lists all menu actions plus many standard text actions. Here's a screenshot of the last menu actions followed by some selection actions.<div><div><div><br><div>
On Fri, May 11, 2012 at 1:32 PM, Luke Vilnis <span dir="ltr"><<a>lvilnis@gmail.com</a>></span> wrote:<br>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I assume Chaitin's constant is involved.<div><div><br><br><div>On Fri, May 11, 2012 at 3:22 PM, Matthias Felleisen <span dir="ltr"><<a>matthias@ccs.neu.edu</a>></span> wrote:<br>
<blockquote 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><div><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>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>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 </div></div></blockquote></div></div></div></blockquote></div></div></div></div></blockquote></div></blockquote></div><br><br>-- <br><div> </div><div>--</div><div>
Stephen De Gabrielle</div><div><a href="mailto:stephen.degabrielle@acm.org" target="_blank">stephen.degabrielle@acm.org</a></div><div>Telephone +44 (0)20 85670911</div><div>Mobile +44 (0)79 85189045</div><div><a href="http://www.degabrielle.name/stephen" target="_blank">http://www.degabrielle.name/stephen</a></div>
<div>----</div><div>Professor: Oh God! I clicked without reading! </div><div>Cubert: And I slightly modified something I own! </div><div>Professor: We're monsters!</div><br>