# HG changeset patch # User Jim Blandy # Date 738578913 0 # Node ID 1166db56c7525688ccdd123a2f634f89e30366f9 # Parent daf2762a353cc54158316924c59aff0c94bf2234 * keyboard.c (menu_bar_items): Bind Qinhibit_quit to Qt while we call the keymap accessors; this gets called during redisplay. diff -r daf2762a353c -r 1166db56c752 src/keyboard.c --- a/src/keyboard.c Fri May 28 08:28:20 1993 +0000 +++ b/src/keyboard.c Fri May 28 08:48:33 1993 +0000 @@ -3059,6 +3059,8 @@ Lisp_Object menu_bar_items () { + int count = specpdl_ptr - specpdl; + /* The number of keymaps we're scanning right now, and the number of keymaps we have allocated space for. */ int nmaps; @@ -3073,6 +3075,12 @@ int mapno; + /* In order to build the menus, we need to call the keymap + accessors. They all call QUIT. But this function is called + during redisplay, during which a quit is fatal. So inhibit + quitting while building the menus. */ + specbind (Qinhibit_quit, Qt); + /* Build our list of keymaps. If we recognize a function key and replace its escape sequence in keybuf with its symbol, or if the sequence starts with a mouse @@ -3108,7 +3116,7 @@ result = menu_bar_one_keymap (def, result); } - return Fnreverse (result); + return unbind_to (count, Fnreverse (result)); } /* Scan one map KEYMAP, accumulating any menu items it defines