<div><br></div>The most important thing I need at<div>this point is a way to bind ^W to</div><div>something like delete-word-backwards.</div><div>Most of the other things I really wanted</div><div>I could do with the 'move' command,</div>
<div>but I can't find something like delete-</div><div>word-backwards at</div><div> <span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); "><a href="http://docs.racket-lang.org/gui/text_.html" target="_blank" style="color: rgb(0, 0, 204); ">http://docs.racket-lang.org/gui/text_.html</a></span></div>
<div>I see the delete command, but surely </div><div>I don't have to build my own delete-</div><div>word-backwards from there when that</div><div>operation must already exist in the</div><div>emacs-like bindings.</div>
<div><br></div><div>Is there not a keybindings file</div><div>somewhere already that does the</div><div>emacs-style bindings, which I </div><div>could just modify to use different</div><div>keys? Am I missing something</div>
<div>fundamental in how this whole</div><div>thing works?</div><div><br></div><div>--DGK</div><div><br><br><div class="gmail_quote">On Sun, Sep 11, 2011 at 12:24 PM, David G. Kay <span dir="ltr"><<a href="mailto:dgkdgk@gmail.com">dgkdgk@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><br></div>Thank you; that's great. I'm most of the way<div>there now.</div><div><br></div><div>Still, I'm finding the text% documentation</div>
<div>tough sledding; the tools seem lower-level</div><div>than I need.</div>
<div><br></div><div>Is there a keybinding file somewhere for</div><div>emacs commands? I think changing the</div><div>actual keystrokes in that file would be the</div><div>easiest way for me to do what I want.</div><div>
<br></div><div>Thanks,</div><div><br></div><div><font color="#888888">--DGK</font><div><div></div><div class="h5"><br><br><div class="gmail_quote">On Sat, Sep 10, 2011 at 2:22 PM, Matthew Flatt <span dir="ltr"><<a href="mailto:mflatt@cs.utah.edu" target="_blank">mflatt@cs.utah.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div></div><div>At Sat, 10 Sep 2011 12:56:29 -0700, "David G. Kay" wrote:<br>
> Hi, everyone;<br>
><br>
> I'd like to rebind some of the DrRacket<br>
> editor keys. (I'm trying to reproduce the<br>
> idiosyncratic editor layout I'm used to;<br>
> it has an emacs flavor but with different<br>
> keys.)<br>
><br>
> To start, I just want to map ^t to move<br>
> up a line, ^v to move down, ^f to move<br>
> left, and ^g to move right.<br>
><br>
> I created this file ("keys.rkt"):<br>
><br>
> #lang s-exp framework/keybinding-lang<br>
><br>
> (keybinding "c:t" (lambda (editor evt) (send editor previous-line)))<br>
> (keybinding "c:v" (lambda (editor evt) (send editor next-line)))<br>
> (keybinding "c:f" (lambda (editor evt) (send editor backward-character)))<br>
> (keybinding "c:g" (lambda (editor evt) (send editor forward-character)))<br>
><br>
><br>
> I add the file using "Add User-defined<br>
> Keybindings" in DrRacket. But I get<br>
> this message as soon as I type one of<br>
> my rebound keys:<br>
><br>
> Error running keybinding .../Scheme/keys.rkt:18:18<br>
><br>
> send: no such method: previous-line for class: ...engine/test-tool.scm:36:6<br>
><br>
><br>
> It's complaining about the previous-line<br>
> method, but that's listed in section 7<br>
> (Editor Functions) of the Racket Graphical<br>
> Interface Toolkit manual:<br>
> <a href="http://docs.racket-lang.org/gui/Editor_Functions.html?q=Editor_Functions&q=edit" target="_blank">http://docs.racket-lang.org/gui/Editor_Functions.html?q=Editor_Functions&q=edit</a><br>
> or%25&q=forward-select-word&q=key%20bindings<br>
<br>
</div></div>I can see how it's confusing, but that isn't a list of methods. It's a<br>
list of strings that are mapped to functions in a keymap%, where the<br>
string is eventually converted to a function through the<br>
`call-function' method of keymap%. The extra level of indirection is an<br>
ugly artifact of the days when parts of the GUI toolkit were<br>
implemented in C++.<br>
<br>
<br>
For text-editor methods, look here:<br>
<br>
<a href="http://docs.racket-lang.org/gui/text_.html" target="_blank">http://docs.racket-lang.org/gui/text_.html</a><br>
<br>
I think you want to use the `move' method.<br>
<br>
</blockquote></div><br>
</div></div></div>
</blockquote></div><br></div>