Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: David Adams <daveadams@gmail.com>
To: sup-talk <sup-talk@rubyforge.org>
Subject: [sup-talk] Best practice for customizing keymaps?
Date: Mon, 19 Oct 2009 14:46:41 -0400	[thread overview]
Message-ID: <87af9a490910191146o6b34b81ev4723521d17924ae4@mail.gmail.com> (raw)

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


                 reply	other threads:[~2009-10-19 19:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87af9a490910191146o6b34b81ev4723521d17924ae4@mail.gmail.com \
    --to=daveadams@gmail.com \
    --cc=sup-talk@rubyforge.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox