Index: ChangeLog =================================================================== RCS file: /cvsroot/ratpoison/ratpoison/ChangeLog,v retrieving revision 1.363 diff -u -r1.363 ChangeLog --- ChangeLog 15 Jan 2005 09:06:32 -0000 1.363 +++ ChangeLog 15 Jan 2005 13:52:16 -0000 @@ -1,1 +1,7 @@ +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-01-15 Ryan Yeske Index: configure.in =================================================================== RCS file: /cvsroot/ratpoison/ratpoison/configure.in,v retrieving revision 1.49 diff -u -r1.49 configure.in --- configure.in 3 Dec 2004 01:20:56 -0000 1.49 +++ configure.in 15 Jan 2005 13:52:16 -0000 @@ -43,6 +43,15 @@ term_prog=$withval, term_prog="xterm") AC_DEFINE_UNQUOTED(TERM_PROG, "$term_prog", X terminal emulator to use) +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: src/actions.c =================================================================== RCS file: /cvsroot/ratpoison/ratpoison/src/actions.c,v retrieving revision 1.228 diff -u -r1.228 actions.c --- src/actions.c 15 Jan 2005 05:20:21 -0000 1.228 +++ src/actions.c 15 Jan 2005 13:52:16 -0000 @@ -601,6 +601,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); @@ -691,6 +694,9 @@ add_alias ("defwinliststyle", "set winliststyle"); add_alias ("defframesels", "set framesels"); add_alias ("defmaxundos", "set maxundos"); +#ifdef MENU_PROG + add_alias ("menu", "exec \"" MENU_PROG "\""); +#endif } void Index: src/main.c =================================================================== RCS file: /cvsroot/ratpoison/ratpoison/src/main.c,v retrieving revision 1.111 diff -u -r1.111 main.c --- src/main.c 15 Jan 2005 04:16:54 -0000 1.111 +++ src/main.c 15 Jan 2005 13:52:16 -0000 @@ -421,7 +421,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); @@ -430,27 +436,45 @@ /* 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); + help_show = help; + } + else + { + help = NULL; + help_show = ":help"; + } - free (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: src/messages.h =================================================================== RCS file: /cvsroot/ratpoison/ratpoison/src/messages.h,v retrieving revision 1.17 diff -u -r1.17 messages.h --- src/messages.h 9 Dec 2004 05:18:11 -0000 1.17 +++ src/messages.h 15 Jan 2005 13:52:16 -0000 @@ -46,6 +46,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 MESSAGE_FRAME_STRING "Current Frame" #endif /* ! _RATPOISON_MESSAGES_H */