changeset 3255:b04e2b131ef0

(menu_bar_items): Save Vinhibit_quit by hand instead of using specbind.
author Richard M. Stallman <rms@gnu.org>
date Sat, 29 May 1993 17:58:03 +0000
parents e1f5f8f23d90
children 14eb227cad41
files src/keyboard.c
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/keyboard.c	Sat May 29 16:38:15 1993 +0000
+++ b/src/keyboard.c	Sat May 29 17:58:03 1993 +0000
@@ -3059,8 +3059,6 @@
 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;
@@ -3074,12 +3072,16 @@
   Lisp_Object result;
 
   int mapno;
+  Lisp_Object oquit;
 
   /* 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);
+     quitting while building the menus.
+     We do this instead of specbind because (1) errors will clear it anyway
+     and (2) this avoids risk of specpdl overflow.  */
+  oquit = Vinhibit_quit;
+  Vinhibit_quit = Qt; 
 
   /* Build our list of keymaps.
      If we recognize a function key and replace its escape sequence in
@@ -3116,7 +3118,8 @@
 	result = menu_bar_one_keymap (def, result);
     }
 
-  return unbind_to (count, Fnreverse (result));
+  Vinhibit_quit = oquit;
+  return Fnreverse (result);
 }
 
 /* Scan one map KEYMAP, accumulating any menu items it defines