2001-09-12 Gergely Nagy * src/actions.c (cmd_help): do not display symbind commands, but attempt to resolve them, and display their target diff -urd ratpoison.symbind/src/actions.c ratpoison/src/actions.c --- ratpoison.symbind/src/actions.c Wed Sep 12 14:35:34 2001 +++ ratpoison/src/actions.c Wed Sep 12 14:37:32 2001 @@ -1239,13 +1239,37 @@ } else { - XDrawString (dpy, s->help_window, s->normal_gc, - x, y + defaults.font->max_bounds.ascent, - key_actions[i].data, strlen (key_actions[i].data)); + char *cmd = NULL; + if (!strncmp (key_actions[i].data, "symbind", 7)) + { + char *data2, *key; + data2 = strdup (key_actions[i].data); + key = strtok (data2, " "); + key = strtok (NULL, "\0"); - if (XTextWidth (defaults.font, key_actions[i].data, strlen (key_actions[i].data)) > max_width) + cmd = find_command_by_keydesc (key); + + if (cmd) + { + XDrawString (dpy, s->help_window, s->normal_gc, x, + y + defaults.font->max_bounds.ascent, cmd, + strlen (cmd)); + if (XTextWidth (defaults.font, cmd, strlen (cmd)) > max_width) + { + max_width = XTextWidth (defaults.font, cmd, strlen (cmd)); + } + } + } + if (cmd == NULL) { - max_width = XTextWidth (defaults.font, key_actions[i].data, strlen (key_actions[i].data)); + XDrawString (dpy, s->help_window, s->normal_gc, + x, y + defaults.font->max_bounds.ascent, + key_actions[i].data, strlen (key_actions[i].data)); + + if (XTextWidth (defaults.font, key_actions[i].data, strlen (key_actions[i].data)) > max_width) + { + max_width = XTextWidth (defaults.font, key_actions[i].data, strlen (key_actions[i].data)); + } } }