diff options
| author | Stefan Monnier | 2012-09-11 20:14:50 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2012-09-11 20:14:50 -0400 |
| commit | 45b82ad0ebedaa1b7094912e218bea1510c33feb (patch) | |
| tree | 278e50931ea92f8f3201fcb855d454f2202b2f66 /src | |
| parent | 50f2e553ce21a2901e9f935650018289c11fcc39 (diff) | |
| download | emacs-45b82ad0ebedaa1b7094912e218bea1510c33feb.tar.gz emacs-45b82ad0ebedaa1b7094912e218bea1510c33feb.zip | |
* src/eval.c: Add `inhibit-debugger'.
(Qinhibit_debugger): New symbol.
(call_debugger): Bind it instead of Qdebug_on_error.
(maybe_call_debugger): Test Vinhibit_debugger.
(syms_of_eval): Define inhibit-debugger.
* src/xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
(syms_of_xdisp): Remove inhibit-debug-on-message.
* lisp/emacs-lisp/debug.el (debug): Don't bind debug-on-error since
inhibit-debugger is bound instead.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 10 | ||||
| -rw-r--r-- | src/composite.h | 2 | ||||
| -rw-r--r-- | src/eval.c | 15 | ||||
| -rw-r--r-- | src/keyboard.c | 4 | ||||
| -rw-r--r-- | src/xdisp.c | 19 |
5 files changed, 27 insertions, 23 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index f4cae50d8ed..a005b1d80c7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * eval.c: Add `inhibit-debugger'. | ||
| 4 | (Qinhibit_debugger): New symbol. | ||
| 5 | (call_debugger): Bind it instead of Qdebug_on_error. | ||
| 6 | (maybe_call_debugger): Test Vinhibit_debugger. | ||
| 7 | (syms_of_eval): Define inhibit-debugger. | ||
| 8 | * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message. | ||
| 9 | (syms_of_xdisp): Remove inhibit-debug-on-message. | ||
| 10 | |||
| 1 | 2012-09-11 Paul Eggert <eggert@cs.ucla.edu> | 11 | 2012-09-11 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 12 | ||
| 3 | Avoid _setjmp/_longjmp problems with local nonvolatile variables. | 13 | Avoid _setjmp/_longjmp problems with local nonvolatile variables. |
diff --git a/src/composite.h b/src/composite.h index 68f5b27ee42..9462b932c66 100644 --- a/src/composite.h +++ b/src/composite.h | |||
| @@ -113,7 +113,7 @@ extern Lisp_Object composition_temp; | |||
| 113 | && (end - start) == COMPOSITION_LENGTH (prop)) | 113 | && (end - start) == COMPOSITION_LENGTH (prop)) |
| 114 | 114 | ||
| 115 | /* Return the Nth glyph of composition specified by CMP. CMP is a | 115 | /* Return the Nth glyph of composition specified by CMP. CMP is a |
| 116 | pointer to `struct composition'. */ | 116 | pointer to `struct composition'. */ |
| 117 | #define COMPOSITION_GLYPH(cmp, n) \ | 117 | #define COMPOSITION_GLYPH(cmp, n) \ |
| 118 | XINT (XVECTOR (XVECTOR (XHASH_TABLE (composition_hash_table) \ | 118 | XINT (XVECTOR (XVECTOR (XHASH_TABLE (composition_hash_table) \ |
| 119 | ->key_and_value) \ | 119 | ->key_and_value) \ |
diff --git a/src/eval.c b/src/eval.c index 4f0d6c69a51..8a8a507a1b6 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -69,7 +69,7 @@ Lisp_Object Qautoload, Qmacro, Qexit, Qinteractive, Qcommandp; | |||
| 69 | Lisp_Object Qinhibit_quit; | 69 | Lisp_Object Qinhibit_quit; |
| 70 | Lisp_Object Qand_rest; | 70 | Lisp_Object Qand_rest; |
| 71 | static Lisp_Object Qand_optional; | 71 | static Lisp_Object Qand_optional; |
| 72 | static Lisp_Object Qdebug_on_error; | 72 | static Lisp_Object Qinhibit_debugger; |
| 73 | static Lisp_Object Qdeclare; | 73 | static Lisp_Object Qdeclare; |
| 74 | Lisp_Object Qinternal_interpreter_environment, Qclosure; | 74 | Lisp_Object Qinternal_interpreter_environment, Qclosure; |
| 75 | 75 | ||
| @@ -229,7 +229,7 @@ call_debugger (Lisp_Object arg) | |||
| 229 | specbind (intern ("debugger-may-continue"), | 229 | specbind (intern ("debugger-may-continue"), |
| 230 | debug_while_redisplaying ? Qnil : Qt); | 230 | debug_while_redisplaying ? Qnil : Qt); |
| 231 | specbind (Qinhibit_redisplay, Qnil); | 231 | specbind (Qinhibit_redisplay, Qnil); |
| 232 | specbind (Qdebug_on_error, Qnil); | 232 | specbind (Qinhibit_debugger, Qt); |
| 233 | 233 | ||
| 234 | #if 0 /* Binding this prevents execution of Lisp code during | 234 | #if 0 /* Binding this prevents execution of Lisp code during |
| 235 | redisplay, which necessarily leads to display problems. */ | 235 | redisplay, which necessarily leads to display problems. */ |
| @@ -1725,6 +1725,7 @@ maybe_call_debugger (Lisp_Object conditions, Lisp_Object sig, Lisp_Object data) | |||
| 1725 | /* Don't try to run the debugger with interrupts blocked. | 1725 | /* Don't try to run the debugger with interrupts blocked. |
| 1726 | The editing loop would return anyway. */ | 1726 | The editing loop would return anyway. */ |
| 1727 | ! INPUT_BLOCKED_P | 1727 | ! INPUT_BLOCKED_P |
| 1728 | && NILP (Vinhibit_debugger) | ||
| 1728 | /* Does user want to enter debugger for this kind of error? */ | 1729 | /* Does user want to enter debugger for this kind of error? */ |
| 1729 | && (EQ (sig, Qquit) | 1730 | && (EQ (sig, Qquit) |
| 1730 | ? debug_on_quit | 1731 | ? debug_on_quit |
| @@ -3467,7 +3468,7 @@ before making `inhibit-quit' nil. */); | |||
| 3467 | 3468 | ||
| 3468 | DEFSYM (Qinhibit_quit, "inhibit-quit"); | 3469 | DEFSYM (Qinhibit_quit, "inhibit-quit"); |
| 3469 | DEFSYM (Qautoload, "autoload"); | 3470 | DEFSYM (Qautoload, "autoload"); |
| 3470 | DEFSYM (Qdebug_on_error, "debug-on-error"); | 3471 | DEFSYM (Qinhibit_debugger, "inhibit-debugger"); |
| 3471 | DEFSYM (Qmacro, "macro"); | 3472 | DEFSYM (Qmacro, "macro"); |
| 3472 | DEFSYM (Qdeclare, "declare"); | 3473 | DEFSYM (Qdeclare, "declare"); |
| 3473 | 3474 | ||
| @@ -3482,6 +3483,12 @@ before making `inhibit-quit' nil. */); | |||
| 3482 | DEFSYM (Qclosure, "closure"); | 3483 | DEFSYM (Qclosure, "closure"); |
| 3483 | DEFSYM (Qdebug, "debug"); | 3484 | DEFSYM (Qdebug, "debug"); |
| 3484 | 3485 | ||
| 3486 | DEFVAR_LISP ("inhibit-debugger", Vinhibit_debugger, | ||
| 3487 | doc: /* Non-nil means never enter the debugger. | ||
| 3488 | Normally set while the debugger is already active, to avoid recursive | ||
| 3489 | invocations. */); | ||
| 3490 | Vinhibit_debugger = Qnil; | ||
| 3491 | |||
| 3485 | DEFVAR_LISP ("debug-on-error", Vdebug_on_error, | 3492 | DEFVAR_LISP ("debug-on-error", Vdebug_on_error, |
| 3486 | doc: /* Non-nil means enter debugger if an error is signaled. | 3493 | doc: /* Non-nil means enter debugger if an error is signaled. |
| 3487 | Does not apply to errors handled by `condition-case' or those | 3494 | Does not apply to errors handled by `condition-case' or those |
| @@ -3491,7 +3498,7 @@ if one of its condition symbols appears in the list. | |||
| 3491 | When you evaluate an expression interactively, this variable | 3498 | When you evaluate an expression interactively, this variable |
| 3492 | is temporarily non-nil if `eval-expression-debug-on-error' is non-nil. | 3499 | is temporarily non-nil if `eval-expression-debug-on-error' is non-nil. |
| 3493 | The command `toggle-debug-on-error' toggles this. | 3500 | The command `toggle-debug-on-error' toggles this. |
| 3494 | See also the variable `debug-on-quit'. */); | 3501 | See also the variable `debug-on-quit' and `inhibit-debugger'. */); |
| 3495 | Vdebug_on_error = Qnil; | 3502 | Vdebug_on_error = Qnil; |
| 3496 | 3503 | ||
| 3497 | DEFVAR_LISP ("debug-ignored-errors", Vdebug_ignored_errors, | 3504 | DEFVAR_LISP ("debug-ignored-errors", Vdebug_ignored_errors, |
diff --git a/src/keyboard.c b/src/keyboard.c index 42c67f68ede..8091258578c 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -4133,7 +4133,7 @@ kbd_buffer_get_event (KBOARD **kbp, | |||
| 4133 | *used_mouse_menu = 1; | 4133 | *used_mouse_menu = 1; |
| 4134 | #endif | 4134 | #endif |
| 4135 | #ifdef HAVE_NS | 4135 | #ifdef HAVE_NS |
| 4136 | /* certain system events are non-key events */ | 4136 | /* Certain system events are non-key events. */ |
| 4137 | if (used_mouse_menu | 4137 | if (used_mouse_menu |
| 4138 | && event->kind == NS_NONKEY_EVENT) | 4138 | && event->kind == NS_NONKEY_EVENT) |
| 4139 | *used_mouse_menu = 1; | 4139 | *used_mouse_menu = 1; |
| @@ -4161,7 +4161,7 @@ kbd_buffer_get_event (KBOARD **kbp, | |||
| 4161 | so x remains nil. */ | 4161 | so x remains nil. */ |
| 4162 | x = Qnil; | 4162 | x = Qnil; |
| 4163 | 4163 | ||
| 4164 | /* XXX Can f or mouse_position_hook be NULL here? */ | 4164 | /* XXX Can f or mouse_position_hook be NULL here? */ |
| 4165 | if (f && FRAME_TERMINAL (f)->mouse_position_hook) | 4165 | if (f && FRAME_TERMINAL (f)->mouse_position_hook) |
| 4166 | (*FRAME_TERMINAL (f)->mouse_position_hook) (&f, 0, &bar_window, | 4166 | (*FRAME_TERMINAL (f)->mouse_position_hook) (&f, 0, &bar_window, |
| 4167 | &part, &x, &y, &t); | 4167 | &part, &x, &y, &t); |
diff --git a/src/xdisp.c b/src/xdisp.c index c1e05d6df15..e9d9595d91e 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -364,7 +364,6 @@ static Lisp_Object Qslice; | |||
| 364 | Lisp_Object Qcenter; | 364 | Lisp_Object Qcenter; |
| 365 | static Lisp_Object Qmargin, Qpointer; | 365 | static Lisp_Object Qmargin, Qpointer; |
| 366 | static Lisp_Object Qline_height; | 366 | static Lisp_Object Qline_height; |
| 367 | static Lisp_Object Qinhibit_debug_on_message; | ||
| 368 | 367 | ||
| 369 | /* These setters are used only in this file, so they can be private. */ | 368 | /* These setters are used only in this file, so they can be private. */ |
| 370 | static inline void | 369 | static inline void |
| @@ -10590,8 +10589,6 @@ static void | |||
| 10590 | set_message (const char *s, Lisp_Object string, | 10589 | set_message (const char *s, Lisp_Object string, |
| 10591 | ptrdiff_t nbytes, int multibyte_p) | 10590 | ptrdiff_t nbytes, int multibyte_p) |
| 10592 | { | 10591 | { |
| 10593 | ptrdiff_t count = SPECPDL_INDEX (); | ||
| 10594 | |||
| 10595 | message_enable_multibyte | 10592 | message_enable_multibyte |
| 10596 | = ((s && multibyte_p) | 10593 | = ((s && multibyte_p) |
| 10597 | || (STRINGP (string) && STRING_MULTIBYTE (string))); | 10594 | || (STRINGP (string) && STRING_MULTIBYTE (string))); |
| @@ -10601,14 +10598,9 @@ set_message (const char *s, Lisp_Object string, | |||
| 10601 | message_buf_print = 0; | 10598 | message_buf_print = 0; |
| 10602 | help_echo_showing_p = 0; | 10599 | help_echo_showing_p = 0; |
| 10603 | 10600 | ||
| 10604 | if (NILP (Vinhibit_debug_on_message) && STRINGP (Vdebug_on_message) | 10601 | if (STRINGP (Vdebug_on_message) |
| 10605 | && fast_string_match (Vdebug_on_message, string) >= 0) | 10602 | && fast_string_match (Vdebug_on_message, string) >= 0) |
| 10606 | { | 10603 | call_debugger (list2 (Qerror, string)); |
| 10607 | specbind (Qinhibit_debug_on_message, Qt); | ||
| 10608 | call_debugger (list2 (Qerror, string)); | ||
| 10609 | } | ||
| 10610 | |||
| 10611 | unbind_to (count, Qnil); | ||
| 10612 | } | 10604 | } |
| 10613 | 10605 | ||
| 10614 | 10606 | ||
| @@ -12800,7 +12792,7 @@ overlay_arrow_at_row (struct it *it, struct glyph_row *row) | |||
| 12800 | return make_number (fringe_bitmap); | 12792 | return make_number (fringe_bitmap); |
| 12801 | } | 12793 | } |
| 12802 | #endif | 12794 | #endif |
| 12803 | return make_number (-1); /* Use default arrow bitmap */ | 12795 | return make_number (-1); /* Use default arrow bitmap. */ |
| 12804 | } | 12796 | } |
| 12805 | return overlay_arrow_string_or_property (var); | 12797 | return overlay_arrow_string_or_property (var); |
| 12806 | } | 12798 | } |
| @@ -29316,11 +29308,6 @@ Its value should be an ASCII acronym string, `hex-code', `empty-box', or | |||
| 29316 | DEFVAR_LISP ("debug-on-message", Vdebug_on_message, | 29308 | DEFVAR_LISP ("debug-on-message", Vdebug_on_message, |
| 29317 | doc: /* If non-nil, debug if a message matching this regexp is displayed. */); | 29309 | doc: /* If non-nil, debug if a message matching this regexp is displayed. */); |
| 29318 | Vdebug_on_message = Qnil; | 29310 | Vdebug_on_message = Qnil; |
| 29319 | |||
| 29320 | DEFVAR_LISP ("inhibit-debug-on-message", Vinhibit_debug_on_message, | ||
| 29321 | doc: /* If non-nil, inhibit `debug-on-message' from entering the debugger. */); | ||
| 29322 | Vinhibit_debug_on_message = Qnil; | ||
| 29323 | DEFSYM(Qinhibit_debug_on_message, "inhibit-debug-on-message"); | ||
| 29324 | } | 29311 | } |
| 29325 | 29312 | ||
| 29326 | 29313 | ||