|
From: | Gergely Nagy |
Subject: | [RP] A new `symbind' command |
Date: | Wed Sep 12 09:41:02 2001 |
User-agent: | Mutt/1.3.20i |
Greetings! Today, while playing with ratpoison, I accidentally hit C-t C-c, and to my surprise, I saw an xterm.. I was puzzled for a few seconds, since I bound C-t c to aterm in my ratpoisonrc. Then, I realised I actually hit C-c instead of c. Ouch. So I wondered if I could find an easy way to make C-t C-c behave the same as C-t c, even after changing C-t c, but not C-t C-c. That was the original intent behind binding the same command to two different keys, wasn't it? So, I came up with the attached simple patch, that adds a symbind <key> command. How does it work? It receives <key> as the paramater, looks up the command bound to it, and executes that. You can think of it as a symlink to another keybinding. Then, I thought it doesn't look that good in C-t ?, so I wrote another patch, that alters cmd_help to show the target command of a symbind, making it a mixture between a hardlink and a symlink. The only problem with my approach is that it isn't recursive: if A is bound to symbind B, and B is symbind C, then C-t ? will display `symbind C'. I could easily write a symbind resolver if needed, but I think it's just a little overkill. A third patch is attached too, which adds the necessary documentation stuff. Now that I rethink the name, `symbind' might not be the best, as it is easily confused with `bind'.. maybe `keylink' or `link', or something like that would be more appropriate. I leave this to your imagination :) Ideas, flames, praises and flowers welcomed ;) Cheers, -- Gergely Nagy \ mhp/|8]
ratpoison-symbind.diff
Description: Text document
ratpoison-symbind-help.diff
Description: Text document
ratpoison-symbind-docs.diff
Description: Text document
pgpbnOW4mXszw.pgp
Description: PGP signature
[Prev in Thread] | Current Thread | [Next in Thread] |