]> git.eshelyaron.com Git - emacs.git/commitdiff
(inhibit_local_menu_bar_menus): New variable.
authorRichard M. Stallman <rms@gnu.org>
Sat, 8 Oct 1994 04:30:15 +0000 (04:30 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 8 Oct 1994 04:30:15 +0000 (04:30 +0000)
(read_char_x_menu_prompt): Optionally don't use local maps.
(syms_of_keyboard): Set up Lisp variable.

src/keyboard.c

index bbd823b2ede8f848a93ec6a4c9b96e4220daf652..7ddb01741aafbb4ebb72c36544532799fd6df477 100644 (file)
@@ -130,6 +130,9 @@ int waiting_for_input;
 /* True while displaying for echoing.   Delays C-g throwing.  */
 static int echoing;
 
+/* Nonzero means disregard local maps for the menu bar.  */
+static int inhibit_local_menu_bar_menus;
+
 /* Nonzero means C-g should cause immediate error-signal.  */
 int immediate_quit;
 
@@ -4036,6 +4039,13 @@ read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu)
   if (! menu_prompting)
     return Qnil;
 
+  /* Optionally disregard all but the global map.  */
+  if (inhibit_local_menu_bar_menus)
+    {
+      maps += (nmaps - 1);
+      nmaps = 1;
+    }
+
   /* Get the menu name from the first map that has one (a prompt string).  */
   for (mapno = 0; mapno < nmaps; mapno++)
     {
@@ -6133,6 +6143,10 @@ t means double-clicks have no time limit and are detected\n\
 by position only.");
   Vdouble_click_time = make_number (500);
 
+  DEFVAR_BOOL ("inhibit-local-menu-bar-menus", &inhibit_local_menu_bar_menus,
+    "*Non-nil means inhibit local map menu bar menus.");
+  inhibit_local_menu_bar_menus = 0;
+
   DEFVAR_INT ("num-input-keys", &num_input_keys,
     "*Number of complete keys read from the keyboard so far.");
   num_input_keys = 0;