comparison src/cmdloop.c @ 2532:989a7680c221

[xemacs-hg @ 2005-01-29 09:15:55 by ben] Add backtrace when throwing past call_trapping_problems() alloc.c, backtrace.h, bytecode.c, cmdloop.c, eval.c, lisp.h, macros.c: Also include a backtrace when we catch an attempt to throw outside of a function where call_trapping_problems() has been used.
author ben
date Sat, 29 Jan 2005 09:16:00 +0000
parents 04bc9d2f42c7
children facf3239ba30
comparison
equal deleted inserted replaced
2531:7de8d9ab7bbd 2532:989a7680c221
1 /* Editor command loop. 1 /* Editor command loop.
2 Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. 2 Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
3 Copyright (C) 1995, 1996, 2001, 2002 Ben Wing. 3 Copyright (C) 1995, 1996, 2001, 2002, 2003 Ben Wing.
4 4
5 This file is part of XEmacs. 5 This file is part of XEmacs.
6 6
7 XEmacs is free software; you can redistribute it and/or modify it 7 XEmacs is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
288 /* First deal with startup and command-line arguments. A throw 288 /* First deal with startup and command-line arguments. A throw
289 to 'top-level gets us back here directly (does this ever happen?). 289 to 'top-level gets us back here directly (does this ever happen?).
290 Otherwise, this function will return normally when all command- 290 Otherwise, this function will return normally when all command-
291 line arguments have been processed, the user's initialization 291 line arguments have been processed, the user's initialization
292 file has been read in, and the first frame has been created. */ 292 file has been read in, and the first frame has been created. */
293 internal_catch (Qtop_level, top_level_1, Qnil, 0, 0); 293 internal_catch (Qtop_level, top_level_1, Qnil, 0, 0, 0);
294 294
295 /* If an error occurred during startup and the initial console 295 /* If an error occurred during startup and the initial console
296 wasn't created, then die now (the error was already printed out 296 wasn't created, then die now (the error was already printed out
297 on the terminal device). */ 297 on the terminal device). */
298 if (!noninteractive && 298 if (!noninteractive &&
308 { 308 {
309 command_loop_level = 0; 309 command_loop_level = 0;
310 MARK_MODELINE_CHANGED; 310 MARK_MODELINE_CHANGED;
311 /* Now invoke the command loop. It never returns; however, a 311 /* Now invoke the command loop. It never returns; however, a
312 throw to 'top-level will place us at the end of this loop. */ 312 throw to 'top-level will place us at the end of this loop. */
313 internal_catch (Qtop_level, command_loop_2, Qnil, 0, 0); 313 internal_catch (Qtop_level, command_loop_2, Qnil, 0, 0, 0);
314 /* #### wrong with selected-console? */ 314 /* #### wrong with selected-console? */
315 /* We don't actually call clear_echo_area() here, partially 315 /* We don't actually call clear_echo_area() here, partially
316 at least because that runs Lisp code and it may be unsafe 316 at least because that runs Lisp code and it may be unsafe
317 to do so -- we are outside of the normal catches for 317 to do so -- we are outside of the normal catches for
318 errors and such. */ 318 errors and such. */
371 : Qnil); 371 : Qnil);
372 372
373 specbind (Qstandard_output, Qt); 373 specbind (Qstandard_output, Qt);
374 specbind (Qstandard_input, Qt); 374 specbind (Qstandard_input, Qt);
375 375
376 val = internal_catch (Qexit, command_loop_2, Qnil, 0, 0); 376 val = internal_catch (Qexit, command_loop_2, Qnil, 0, 0, 0);
377 377
378 if (EQ (val, Qt)) 378 if (EQ (val, Qt))
379 /* Turn abort-recursive-edit into a quit. */ 379 /* Turn abort-recursive-edit into a quit. */
380 Fsignal (Qquit, Qnil); 380 Fsignal (Qquit, Qnil);
381 381
438 /* #### not correct with Vselected_console */ 438 /* #### not correct with Vselected_console */
439 XCONSOLE (Vselected_console)->prefix_arg = Qnil; 439 XCONSOLE (Vselected_console)->prefix_arg = Qnil;
440 if (NILP (catch_errors)) 440 if (NILP (catch_errors))
441 Fcommand_loop_1 (); 441 Fcommand_loop_1 ();
442 else 442 else
443 internal_catch (Qtop_level, 443 internal_catch (Qtop_level, cold_load_command_loop, Qnil, 0, 0, 0);
444 cold_load_command_loop, Qnil, 0, 0);
445 goto loop; 444 goto loop;
446 RETURN_NOT_REACHED (Qnil); 445 RETURN_NOT_REACHED (Qnil);
447 } 446 }
448 447
449 static Lisp_Object 448 static Lisp_Object