aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/keyboard.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index f1b577ed70f..97527896704 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -3059,6 +3059,8 @@ static Lisp_Object menu_bar_one_keymap ();
3059Lisp_Object 3059Lisp_Object
3060menu_bar_items () 3060menu_bar_items ()
3061{ 3061{
3062 int count = specpdl_ptr - specpdl;
3063
3062 /* The number of keymaps we're scanning right now, and the number of 3064 /* The number of keymaps we're scanning right now, and the number of
3063 keymaps we have allocated space for. */ 3065 keymaps we have allocated space for. */
3064 int nmaps; 3066 int nmaps;
@@ -3073,6 +3075,12 @@ menu_bar_items ()
3073 3075
3074 int mapno; 3076 int mapno;
3075 3077
3078 /* In order to build the menus, we need to call the keymap
3079 accessors. They all call QUIT. But this function is called
3080 during redisplay, during which a quit is fatal. So inhibit
3081 quitting while building the menus. */
3082 specbind (Qinhibit_quit, Qt);
3083
3076 /* Build our list of keymaps. 3084 /* Build our list of keymaps.
3077 If we recognize a function key and replace its escape sequence in 3085 If we recognize a function key and replace its escape sequence in
3078 keybuf with its symbol, or if the sequence starts with a mouse 3086 keybuf with its symbol, or if the sequence starts with a mouse
@@ -3108,7 +3116,7 @@ menu_bar_items ()
3108 result = menu_bar_one_keymap (def, result); 3116 result = menu_bar_one_keymap (def, result);
3109 } 3117 }
3110 3118
3111 return Fnreverse (result); 3119 return unbind_to (count, Fnreverse (result));
3112} 3120}
3113 3121
3114/* Scan one map KEYMAP, accumulating any menu items it defines 3122/* Scan one map KEYMAP, accumulating any menu items it defines