summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsabetts <sabetts>2001-09-13 10:41:06 +0000
committersabetts <sabetts>2001-09-13 10:41:06 +0000
commitd5b04e0048b0f1bd5a3d5a8f6c5f49aecab5ed64 (patch)
treec090d65a07500f30c39851c64bee097339e1cafa
parent20b25a51550f3361e3cdd0608b1801cb56f09bf2 (diff)
downloadratpoison-d5b04e0048b0f1bd5a3d5a8f6c5f49aecab5ed64.zip
unbind the key if no command is passed to the 'bind' command.
-rw-r--r--ChangeLog5
-rw-r--r--TODO5
-rw-r--r--doc/ratpoison.texi3
-rw-r--r--src/actions.c9
4 files changed, 15 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index d6c7ebb..34a0a07 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,11 @@
* src/input.c (update_input_window): Draw a cheap-o cursor
+2001-09-12 Gergely Nagy <algernon@debian.org>
+
+ * src/actions.c (cmd_bind): binding an empty string to a key will
+ unbind the key.
+
2001-09-09 shawn <sabetts@diggin.lamenet.tmp>
* src/conf.h (MAXSIZE_WINDOWS_ARE_TRANSIENTS): defined
diff --git a/TODO b/TODO
index 34da8d0..ab30a44 100644
--- a/TODO
+++ b/TODO
@@ -1,15 +1,12 @@
-*- outline -*-
* command stuff
-** binding an empty string should wipe out old binding
-ryan
-
** general argument parsing strategy
ryan
** return the current setting for the def* command suite
When in non-interactive mode, so scripts that need to change them can
-change them back when they're done.
+change them back when they're done. Low priority.
* implement these screen commands (see the screen info for documentation):
diff --git a/doc/ratpoison.texi b/doc/ratpoison.texi
index 68755e5..3e6a30b 100644
--- a/doc/ratpoison.texi
+++ b/doc/ratpoison.texi
@@ -306,6 +306,9 @@ restart ratpoison:
: bind R exec ratpoison --restart
@end example
+If no command is specified then bind works exactly like @command{unbind},
+unbinding the key.
+
@item clock
Show current time. Disappears after 5 seconds, like all other info bars.
In the default setup, the @kbd{C-t a} keystroke is bound to this command.
diff --git a/src/actions.c b/src/actions.c
index e3101a6..a38c9e7 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -367,7 +367,7 @@ cmd_bind (int interactive, void *data)
if (!data)
{
- message (" bind: two arguments required ");
+ message (" bind: at least one argument required ");
return NULL;
}
@@ -382,11 +382,14 @@ cmd_bind (int interactive, void *data)
}
if (!keydesc)
- message (" bind: two arguments required ");
+ message (" bind: at least one argument required ");
else
{
if (!cmd || !*cmd)
- message (" bind: need a command to bind to key ");
+ {
+ /* If no comand is specified, then unbind the key. */
+ cmd_unbind (interactive, keydesc);
+ }
else
{
struct rp_key *key = parse_keydesc (keydesc);