[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RP] nested keymaps
From: |
Shawn Betts |
Subject: |
[RP] nested keymaps |
Date: |
Mon Sep 1 22:47:04 2003 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 |
Hi folks,
So I've thought about Dan's nested keymap patch and how I'd like to
see it done. I came up with this idea (it's implemented, I just have
to check it in).
4 functions:
newkmap <keymap> - Create a new keymap
delkmap <keymap> - delete a keymap
prefix <keymap> - read a key and execute the command associated with it in
KEYMAP
and
definekey <keymap> <key> <command> - bind KEY to COMMAND in the keymap,
KEYMAP.
so for instance, to hang all the frame splitting and whatnot off the
C-t s, you'd do:
newkmap frame
definekey frame r resize
definekey frame apostrophe fselect
...
bind f prefix frame
and if you wanted to hang a keymap off C-t s j
you'd add:
newkmap wackymap
definekey wackymap t echo foobar
definekey frame j prefix wackymap
So, hitting C-t s j t would show foobar in the message bar.
What do you guys think?
There are some deficiencies:
* you can get mutually recursively nest keymaps. Sorta weird, but you
just have to hit an unbound key to exit the loop.
definekey wackymap t prefix frame
C-t s j t j t j t j t j ...
* It'd be nice to display the full line of keys if a key is unbound:
C-t s j t g unbound key
instead of just
g unbound key
This can be done..I just haven't done it yet.
* The help screen is not really super great
help now takes a keymap and displays the keys on that map. It'd be
nice to write some scripts or something to print emacs style key
listings...
I think this fits with the theme of ratpoison more than Dan's
patch. But it might be a bit weird for people. I'm still excited about
the sneakiness of it, so maybe when that wears off I'll think
otherwise :).
Shawn
- [RP] nested keymaps,
Shawn Betts <=