Mercurial > hg > xemacs-beta
comparison src/cmdloop.c @ 219:262b8bb4a523 r20-4b8
Import from CVS: tag r20-4b8
| author | cvs |
|---|---|
| date | Mon, 13 Aug 2007 10:09:35 +0200 |
| parents | 489f57a838ef |
| children | c5d627a313b1 |
comparison
equal
deleted
inserted
replaced
| 218:c9f226976f56 | 219:262b8bb4a523 |
|---|---|
| 58 Lisp_Object Qcommand_error; | 58 Lisp_Object Qcommand_error; |
| 59 | 59 |
| 60 /* The emergency error handler, before we're ready. */ | 60 /* The emergency error handler, before we're ready. */ |
| 61 Lisp_Object Qreally_early_error_handler; | 61 Lisp_Object Qreally_early_error_handler; |
| 62 | 62 |
| 63 /* Variable defined in Lisp. */ | |
| 64 Lisp_Object Qerrors_deactivate_region; | |
| 65 | |
| 63 static Lisp_Object command_loop_1 (Lisp_Object dummy); | 66 static Lisp_Object command_loop_1 (Lisp_Object dummy); |
| 64 | 67 |
| 65 /* There are two possible command loops -- one written entirely in | 68 /* There are two possible command loops -- one written entirely in |
| 66 C and one written mostly in Lisp, except stuff written in C for | 69 C and one written mostly in Lisp, except stuff written in C for |
| 67 speed. The advantage of the Lisp command loop is that the user | 70 speed. The advantage of the Lisp command loop is that the user |
| 71 static Lisp_Object | 74 static Lisp_Object |
| 72 default_error_handler (Lisp_Object data) | 75 default_error_handler (Lisp_Object data) |
| 73 { | 76 { |
| 74 int speccount = specpdl_depth (); | 77 int speccount = specpdl_depth (); |
| 75 | 78 |
| 79 /* None of this is invoked, normally. This code is almost identical | |
| 80 to the `command-error' function, except `command-error' does cool | |
| 81 tricks with sounds. This function is a fallback, invoked if | |
| 82 command-error is unavailable. */ | |
| 83 | |
| 76 Fding (Qnil, Qnil, Qnil); | 84 Fding (Qnil, Qnil, Qnil); |
| 77 zmacs_deactivate_region (); | 85 |
| 86 if (!NILP (Fboundp (Qerrors_deactivate_region)) | |
| 87 && !NILP (Fsymbol_value (Qerrors_deactivate_region))) | |
| 88 zmacs_deactivate_region (); | |
| 78 Fdiscard_input (); | 89 Fdiscard_input (); |
| 79 specbind (Qinhibit_quit, Qt); | 90 specbind (Qinhibit_quit, Qt); |
| 80 Vstandard_output = Qt; | 91 Vstandard_output = Qt; |
| 81 Vstandard_input = Qt; | 92 Vstandard_input = Qt; |
| 82 Vexecuting_macro = Qnil; | 93 Vexecuting_macro = Qnil; |
| 94 Fset (intern ("last-error"), data); | |
| 83 clear_echo_area (selected_frame (), Qnil, 0); | 95 clear_echo_area (selected_frame (), Qnil, 0); |
| 84 data = Fprin1_to_string (data, Qnil); | 96 Fdisplay_error (data, Qt); |
| 85 message ("Error: %s", XSTRING_DATA (data)); | |
| 86 check_quit (); /* make Vquit_flag accurate */ | 97 check_quit (); /* make Vquit_flag accurate */ |
| 87 Vquit_flag = Qnil; | 98 Vquit_flag = Qnil; |
| 88 return (unbind_to (speccount, Qt)); | 99 return (unbind_to (speccount, Qt)); |
| 89 } | 100 } |
| 90 | 101 |
| 580 syms_of_cmdloop (void) | 591 syms_of_cmdloop (void) |
| 581 { | 592 { |
| 582 defsymbol (&Qcommand_error, "command-error"); | 593 defsymbol (&Qcommand_error, "command-error"); |
| 583 defsymbol (&Qreally_early_error_handler, "really-early-error-handler"); | 594 defsymbol (&Qreally_early_error_handler, "really-early-error-handler"); |
| 584 defsymbol (&Qtop_level, "top-level"); | 595 defsymbol (&Qtop_level, "top-level"); |
| 596 defsymbol (&Qerrors_deactivate_region, "errors-deactivate-region"); | |
| 585 | 597 |
| 586 #ifndef LISP_COMMAND_LOOP | 598 #ifndef LISP_COMMAND_LOOP |
| 587 DEFSUBR (Frecursive_edit); | 599 DEFSUBR (Frecursive_edit); |
| 588 #endif | 600 #endif |
| 589 DEFSUBR (Freally_early_error_handler); | 601 DEFSUBR (Freally_early_error_handler); |
