diff src/event-stream.c @ 177:6075d714658b r20-3b15

Import from CVS: tag r20-3b15
author cvs
date Mon, 13 Aug 2007 09:51:16 +0200
parents 2d532a89d707
children 9ad43877534d
line wrap: on
line diff
--- a/src/event-stream.c	Mon Aug 13 09:50:16 2007 +0200
+++ b/src/event-stream.c	Mon Aug 13 09:51:16 2007 +0200
@@ -3021,7 +3021,7 @@
   return event_binding (event0, 1);
 }
 
-#ifdef HAVE_X_WINDOWS
+#if defined(HAVE_X_WINDOWS) && defined(HAVE_MENUBARS)
 static void
 menu_move_up (void)
 {
@@ -3498,8 +3498,12 @@
   return Qnil;
 }
 
-void
-event_menu_accelerate ()
+
+DEFUN ("accelerate-menu", Faccelerate_menu, 0, 0, "_", /*
+Make the menubar active.  Menu items can be selected using menu accelerators
+or by actions defined in menu-accelerator-map.
+*/
+       ())
 {
   struct console *con = XCONSOLE (Vselected_console);
   struct frame *f = XFRAME (CONSOLE_SELECTED_FRAME (con));
@@ -3515,8 +3519,10 @@
   /* menu accelerator keys don't go into keyboard macros */
   if (!NILP (con->defining_kbd_macro) && NILP (Vexecuting_macro))
     con->kbd_macro_ptr = con->kbd_macro_end;
+  
+  return Qnil;
 }
-#endif /* HAVE_X_WINDOWS */
+#endif /* HAVE_X_WINDOWS && HAVE_MENUBARS */
 
 /* See if we can do function-key-map or key-translation-map translation
    on the current events in the command builder.  If so, do this, and
@@ -3646,7 +3652,7 @@
     return Qnil;
 
   /* if we're currently in a menu accelerator, check there for further events */
-#ifdef HAVE_X_WINDOWS
+#if defined(HAVE_X_WINDOWS) && defined(HAVE_MENUBAR)
   if (lw_menu_active)
     {
       result = command_builder_operate_menu_accelerator (builder);
@@ -3660,7 +3666,7 @@
       if (NILP (result))
 #endif
 	result = command_builder_find_leaf_1 (builder);
-#ifdef HAVE_X_WINDOWS
+#if defined(HAVE_X_WINDOWS) && defined(HAVE_MENUBAR)
       if (NILP (result)
 	  && EQ (Vmenu_accelerator_enabled, Qmenu_fallback))
 	result = command_builder_find_menu_accelerator (builder);
@@ -4858,6 +4864,7 @@
   DEFSUBR (Fthis_command_keys);
   DEFSUBR (Freset_this_command_lengths);
   DEFSUBR (Fopen_dribble_file);
+  DEFSUBR (Faccelerate_menu);
 
   defsymbol (&Qpre_command_hook, "pre-command-hook");
   defsymbol (&Qpost_command_hook, "post-command-hook");