This patch adds an --with-menu that allows to specify a menu command that will be available with :menu and with "C-t ." Index: ratpoison-1.4.4/ChangeLog =================================================================== --- ratpoison-1.4.4.orig/ChangeLog 2009-04-27 14:43:28.000000000 +0200 +++ ratpoison-1.4.4/ChangeLog 2009-04-27 14:47:28.000000000 +0200 @@ -1,3 +1,9 @@ +2005-01-15 Bernhard R. Link + + * configure.in: add --with-menu to specify a menu program + * src/action.c: add menu alias and binding if menu specified + * src/main.c: tell menu command if menu specified + 2005-06-28 Bernhard R. Link * src/split.c: new functions enlarge_frame_{left,up,right,down} Index: ratpoison-1.4.4/src/main.c =================================================================== --- ratpoison-1.4.4.orig/src/main.c 2009-04-13 11:15:46.000000000 +0200 +++ ratpoison-1.4.4/src/main.c 2009-04-27 14:47:28.000000000 +0200 @@ -467,7 +467,13 @@ { rp_action *help_action; char *prefix, *help; + const char *help_show; rp_keymap *map; +#ifdef MENU_PROG + rp_action *menu_action; + char *menu; + const char *menu_show; +#endif prefix = keysym_to_string (prefix_key.sym, prefix_key.state); @@ -476,27 +482,44 @@ /* Find the help key binding. */ help_action = find_keybinding_by_action ("help " ROOT_KEYMAP, map); if (help_action) - help = keysym_to_string (help_action->key, help_action->state); - else - help = NULL; - - - if (help) { + help = keysym_to_string (help_action->key, help_action->state); /* A little kludge to use ? instead of `question' for the help key. */ if (!strcmp (help, "question")) - marked_message_printf (0, 0, MESSAGE_WELCOME, prefix, "?"); + help_show = "?"; else - marked_message_printf (0, 0, MESSAGE_WELCOME, prefix, help); - - free (help); + help_show = help; + } + else + { + help = NULL; + help_show = ":help"; + } +#ifdef MENU_PROG + /* Find the menu key binding. */ + menu_action = find_keybinding_by_action ("menu", map); + if (menu_action) + { + menu = keysym_to_string (menu_action->key, menu_action->state); + if (!strcmp (menu, "period")) + menu_show = "."; + else + menu_show = menu; } else { - marked_message_printf (0, 0, MESSAGE_WELCOME, prefix, ":help"); + menu = NULL; + menu_show = ":menu"; } + marked_message_printf (0, 0, MESSAGE_WELCOME_MENU, prefix, help_show, + prefix, menu_show); + free(menu); +#else + marked_message_printf (0, 0, MESSAGE_WELCOME, prefix, help_show); +#endif + free(help); free (prefix); } Index: ratpoison-1.4.4/src/actions.c =================================================================== --- ratpoison-1.4.4.orig/src/actions.c 2009-04-27 14:43:28.000000000 +0200 +++ ratpoison-1.4.4/src/actions.c 2009-04-27 14:47:28.000000000 +0200 @@ -725,6 +725,9 @@ add_keybinding (prefix_key.sym, prefix_key.state, "other", map); add_keybinding (prefix_key.sym, 0, "meta", map); add_keybinding (XK_g, RP_CONTROL_MASK, "abort", map); +#ifdef MENU_PROG + add_keybinding (XK_period, 0, "menu", map); +#endif add_keybinding (XK_0, 0, "select 0", map); add_keybinding (XK_1, 0, "select 1", map); add_keybinding (XK_2, 0, "select 2", map); @@ -811,6 +814,10 @@ add_alias ("unbind", "undefinekey " ROOT_KEYMAP); add_alias ("bind", "definekey " ROOT_KEYMAP); add_alias ("split", "vsplit"); + +#ifdef MENU_PROG + add_alias ("menu", "exec " MENU_PROG ); +#endif } cmdret * Index: ratpoison-1.4.4/configure.in =================================================================== --- ratpoison-1.4.4.orig/configure.in 2009-04-27 03:55:10.000000000 +0200 +++ ratpoison-1.4.4/configure.in 2009-04-27 14:47:28.000000000 +0200 @@ -72,6 +72,15 @@ AC_SUBST(XFT_CFLAGS) AC_SUBST(XFT_LIBS) +AC_ARG_WITH(menu, [ --with-menu=PROG set a external menu program to be advertised ], +menu_prog="$withval", menu_prog="") + +if test "$menu_prog" != "no" && ! test -z "$menu_prog" ; then +AC_DEFINE_UNQUOTED(MENU_PROG, "$menu_prog", external menu program to advertise) +AC_MSG_CHECKING(external menu program) +AC_MSG_RESULT($menu_prog) +fi + dnl Checks for programs. AC_CHECK_TOOL(CC, gcc) AC_PROG_CC Index: ratpoison-1.4.4/src/messages.h =================================================================== --- ratpoison-1.4.4.orig/src/messages.h 2009-04-13 03:52:16.000000000 +0200 +++ ratpoison-1.4.4/src/messages.h 2009-04-27 14:47:28.000000000 +0200 @@ -50,6 +50,7 @@ #define MESSAGE_PROMPT_VAR_VALUE "Value: " #define MESSAGE_WELCOME "Welcome to ratpoison! Hit `%s %s' for help." +#define MESSAGE_WELCOME_MENU "Welcome to ratpoison! Hit `%s %s' for help. `%s %s' for menu." #define EMPTY_FRAME_MESSAGE "Current Frame"