From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.90.117.16 with SMTP id p16cs244866agc; Mon, 19 Oct 2009 12:15:17 -0700 (PDT) Received: by 10.224.35.71 with SMTP id o7mr2768782qad.331.1255979717488; Mon, 19 Oct 2009 12:15:17 -0700 (PDT) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id 17si6286977qyk.1.2009.10.19.12.15.17; Mon, 19 Oct 2009 12:15:17 -0700 (PDT) Received-SPF: pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-talk-bounces@rubyforge.org; dkim=neutral (body hash did not verify) header.i=@gmail.com Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 3EE471D78859; Mon, 19 Oct 2009 15:15:17 -0400 (EDT) X-Greylist: delayed 1275 seconds by postgrey-1.31 at rubycentral.org; Mon, 19 Oct 2009 15:15:13 EDT Received: from mail-pw0-f60.google.com (mail-pw0-f60.google.com [209.85.160.60]) by rubyforge.org (Postfix) with ESMTP id 150C01588060 for ; Mon, 19 Oct 2009 15:15:13 -0400 (EDT) Received: by pwj15 with SMTP id 15so831945pwj.19 for ; Mon, 19 Oct 2009 12:15:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=1ooDmHr/f3IJ4r1svhsVM2lZEnTins3YEyUQv1mdn2w=; b=k0nhJIGJlr9Y34HrtX1qJ40g0cMep6MyYjpadd3cMS0g/tM7D1hRLYTf90XMThX8qd YpVCgzFRpLnJF4whXzVPGlDKEbdJIuDNBAn1KFQAr1zSVn6vGr+aZhOQcWHOLvpD7A67 brTc4Kc3ECDkBxl9SwoDtbBgTvw0fWbzlGroY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=nizJYa8lD2lwu5ouTMBqRj73S2FoVQQhxsF0al0BLYRpgMMhnNw1Qm+VYVCVmNXkzr Z8amO23QYkG5s/H6tpCadJIFTS0jhUtdS8rb3UmrGPT5Hm47fxPaEL8KdaGomgV2X3eK kc4pHGw9+rzI6J0KsXz7s5aSBv6GvvpW49AEY= MIME-Version: 1.0 Received: by 10.142.247.6 with SMTP id u6mr341067wfh.181.1255978001474; Mon, 19 Oct 2009 11:46:41 -0700 (PDT) Date: Mon, 19 Oct 2009 14:46:41 -0400 Message-ID: <87af9a490910191146o6b34b81ev4723521d17924ae4@mail.gmail.com> From: David Adams To: sup-talk Subject: [sup-talk] Best practice for customizing keymaps? X-BeenThere: sup-talk@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: User & developer discussion of Sup List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-talk-bounces@rubyforge.org Errors-To: sup-talk-bounces@rubyforge.org Hello everyone, I'd like to make some customizations to the default keymaps for a few modes, and I was wondering what was the safest way to do so. On the Hooks wiki page, the entry for startup.rb shows how to add keystrokes, but based on trying that example out, it appears to work only for adding new keystrokes, not overriding existing ones. So after poking around at the code a bit, dropping this code into startup.rb seems to work to entirely replace a keymap with my preferences: class Redwood::Mode @@keymaps[Redwood::ThreadViewMode] = Redwood::Keymap.new do |k| # key mappings omitted end end So my questions are: Is this unsafe in any way (other than that new versions of sup may invalidate the specifics of keymap implementation)? And is there a better way? Thanks! -dave _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk