aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1993-05-29 17:58:03 +0000
committerRichard M. Stallman1993-05-29 17:58:03 +0000
commit47d319aaa867623804d35934ce33596afdeb151d (patch)
treedb55e102980be6772965da97c83b7890a4db52b7 /src
parent2b7f46c9a2c32fed4c5e43b1f19a748e4a6ea69a (diff)
downloademacs-47d319aaa867623804d35934ce33596afdeb151d.tar.gz
emacs-47d319aaa867623804d35934ce33596afdeb151d.zip
(menu_bar_items): Save Vinhibit_quit by hand
instead of using specbind.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 97527896704..0725bf2f105 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -3059,8 +3059,6 @@ 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
3064 /* The number of keymaps we're scanning right now, and the number of 3062 /* The number of keymaps we're scanning right now, and the number of
3065 keymaps we have allocated space for. */ 3063 keymaps we have allocated space for. */
3066 int nmaps; 3064 int nmaps;
@@ -3074,12 +3072,16 @@ menu_bar_items ()
3074 Lisp_Object result; 3072 Lisp_Object result;
3075 3073
3076 int mapno; 3074 int mapno;
3075 Lisp_Object oquit;
3077 3076
3078 /* In order to build the menus, we need to call the keymap 3077 /* In order to build the menus, we need to call the keymap
3079 accessors. They all call QUIT. But this function is called 3078 accessors. They all call QUIT. But this function is called
3080 during redisplay, during which a quit is fatal. So inhibit 3079 during redisplay, during which a quit is fatal. So inhibit
3081 quitting while building the menus. */ 3080 quitting while building the menus.
3082 specbind (Qinhibit_quit, Qt); 3081 We do this instead of specbind because (1) errors will clear it anyway
3082 and (2) this avoids risk of specpdl overflow. */
3083 oquit = Vinhibit_quit;
3084 Vinhibit_quit = Qt;
3083 3085
3084 /* Build our list of keymaps. 3086 /* Build our list of keymaps.
3085 If we recognize a function key and replace its escape sequence in 3087 If we recognize a function key and replace its escape sequence in
@@ -3116,7 +3118,8 @@ menu_bar_items ()
3116 result = menu_bar_one_keymap (def, result); 3118 result = menu_bar_one_keymap (def, result);
3117 } 3119 }
3118 3120
3119 return unbind_to (count, Fnreverse (result)); 3121 Vinhibit_quit = oquit;
3122 return Fnreverse (result);
3120} 3123}
3121 3124
3122/* Scan one map KEYMAP, accumulating any menu items it defines 3125/* Scan one map KEYMAP, accumulating any menu items it defines