comparison src/cmdloop.c @ 138:6608ceec7cf8 r20-2b3

Import from CVS: tag r20-2b3
author cvs
date Mon, 13 Aug 2007 09:31:46 +0200
parents 131b0175ea99
children 3d6bfa290dbd
comparison
equal deleted inserted replaced
137:cae984061f40 138:6608ceec7cf8
214 214
215 /* Avoid confusing the compiler. A helper function for command_loop_2 */ 215 /* Avoid confusing the compiler. A helper function for command_loop_2 */
216 static DOESNT_RETURN 216 static DOESNT_RETURN
217 command_loop_3 (void) 217 command_loop_3 (void)
218 { 218 {
219 #ifdef LWLIB_MENUBARS_LUCID
220 extern int in_menu_callback; /* defined in menubar-x.c */
221 #endif /* LWLIB_MENUBARS_LUCID */
222
223 #ifdef LWLIB_MENUBARS_LUCID
224 /*
225 * #### Fix the menu code so this isn't necessary.
226 *
227 * We cannot allow the lwmenu code to be reentered, because the
228 * code is not written to be reentrant and will crash. Therefore
229 * paths from the menu callbacks back into the menu code have to
230 * be blocked. Fnext_event is the normal path into the menu code,
231 * but waiting to signal an error there is too late in case where
232 * a new command loop has been started. The error will be caught
233 * and Fnext_event will be called again, looping forever. So we
234 * signal an error here to avoid the loop.
235 */
236 if (in_menu_callback)
237 error ("Attempt to enter command_loop_3 inside menu callback");
238 #endif /* LWLIB_MENUBARS_LUCID */
219 /* This function can GC */ 239 /* This function can GC */
220 for (;;) 240 for (;;)
221 { 241 {
222 condition_case_1 (Qerror, command_loop_1, Qnil, cmd_error, Qnil); 242 condition_case_1 (Qerror, command_loop_1, Qnil, cmd_error, Qnil);
223 /* #### wrong with selected-console? */ 243 /* #### wrong with selected-console? */