diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2012-09-11 20:14:50 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2012-09-11 20:14:50 -0400 |
commit | 45b82ad0ebedaa1b7094912e218bea1510c33feb (patch) | |
tree | 278e50931ea92f8f3201fcb855d454f2202b2f66 /src | |
parent | 50f2e553ce21a2901e9f935650018289c11fcc39 (diff) | |
download | emacs-45b82ad0ebedaa1b7094912e218bea1510c33feb.tar.gz |
* 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 @@ +2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca> + + * 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. + * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message. + (syms_of_xdisp): Remove inhibit-debug-on-message. + 2012-09-11 Paul Eggert <eggert@cs.ucla.edu> 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; && (end - start) == COMPOSITION_LENGTH (prop)) /* Return the Nth glyph of composition specified by CMP. CMP is a - pointer to `struct composition'. */ + pointer to `struct composition'. */ #define COMPOSITION_GLYPH(cmp, n) \ XINT (XVECTOR (XVECTOR (XHASH_TABLE (composition_hash_table) \ ->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; Lisp_Object Qinhibit_quit; Lisp_Object Qand_rest; static Lisp_Object Qand_optional; -static Lisp_Object Qdebug_on_error; +static Lisp_Object Qinhibit_debugger; static Lisp_Object Qdeclare; Lisp_Object Qinternal_interpreter_environment, Qclosure; @@ -229,7 +229,7 @@ call_debugger (Lisp_Object arg) specbind (intern ("debugger-may-continue"), debug_while_redisplaying ? Qnil : Qt); specbind (Qinhibit_redisplay, Qnil); - specbind (Qdebug_on_error, Qnil); + specbind (Qinhibit_debugger, Qt); #if 0 /* Binding this prevents execution of Lisp code during redisplay, which necessarily leads to display problems. */ @@ -1725,6 +1725,7 @@ maybe_call_debugger (Lisp_Object conditions, Lisp_Object sig, Lisp_Object data) /* Don't try to run the debugger with interrupts blocked. The editing loop would return anyway. */ ! INPUT_BLOCKED_P + && NILP (Vinhibit_debugger) /* Does user want to enter debugger for this kind of error? */ && (EQ (sig, Qquit) ? debug_on_quit @@ -3467,7 +3468,7 @@ before making `inhibit-quit' nil. */); DEFSYM (Qinhibit_quit, "inhibit-quit"); DEFSYM (Qautoload, "autoload"); - DEFSYM (Qdebug_on_error, "debug-on-error"); + DEFSYM (Qinhibit_debugger, "inhibit-debugger"); DEFSYM (Qmacro, "macro"); DEFSYM (Qdeclare, "declare"); @@ -3482,6 +3483,12 @@ before making `inhibit-quit' nil. */); DEFSYM (Qclosure, "closure"); DEFSYM (Qdebug, "debug"); + DEFVAR_LISP ("inhibit-debugger", Vinhibit_debugger, + doc: /* Non-nil means never enter the debugger. +Normally set while the debugger is already active, to avoid recursive +invocations. */); + Vinhibit_debugger = Qnil; + DEFVAR_LISP ("debug-on-error", Vdebug_on_error, doc: /* Non-nil means enter debugger if an error is signaled. 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. When you evaluate an expression interactively, this variable is temporarily non-nil if `eval-expression-debug-on-error' is non-nil. The command `toggle-debug-on-error' toggles this. -See also the variable `debug-on-quit'. */); +See also the variable `debug-on-quit' and `inhibit-debugger'. */); Vdebug_on_error = Qnil; 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, *used_mouse_menu = 1; #endif #ifdef HAVE_NS - /* certain system events are non-key events */ + /* Certain system events are non-key events. */ if (used_mouse_menu && event->kind == NS_NONKEY_EVENT) *used_mouse_menu = 1; @@ -4161,7 +4161,7 @@ kbd_buffer_get_event (KBOARD **kbp, so x remains nil. */ x = Qnil; - /* XXX Can f or mouse_position_hook be NULL here? */ + /* XXX Can f or mouse_position_hook be NULL here? */ if (f && FRAME_TERMINAL (f)->mouse_position_hook) (*FRAME_TERMINAL (f)->mouse_position_hook) (&f, 0, &bar_window, &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; Lisp_Object Qcenter; static Lisp_Object Qmargin, Qpointer; static Lisp_Object Qline_height; -static Lisp_Object Qinhibit_debug_on_message; /* These setters are used only in this file, so they can be private. */ static inline void @@ -10590,8 +10589,6 @@ static void set_message (const char *s, Lisp_Object string, ptrdiff_t nbytes, int multibyte_p) { - ptrdiff_t count = SPECPDL_INDEX (); - message_enable_multibyte = ((s && multibyte_p) || (STRINGP (string) && STRING_MULTIBYTE (string))); @@ -10601,14 +10598,9 @@ set_message (const char *s, Lisp_Object string, message_buf_print = 0; help_echo_showing_p = 0; - if (NILP (Vinhibit_debug_on_message) && STRINGP (Vdebug_on_message) + if (STRINGP (Vdebug_on_message) && fast_string_match (Vdebug_on_message, string) >= 0) - { - specbind (Qinhibit_debug_on_message, Qt); - call_debugger (list2 (Qerror, string)); - } - - unbind_to (count, Qnil); + call_debugger (list2 (Qerror, string)); } @@ -12800,7 +12792,7 @@ overlay_arrow_at_row (struct it *it, struct glyph_row *row) return make_number (fringe_bitmap); } #endif - return make_number (-1); /* Use default arrow bitmap */ + return make_number (-1); /* Use default arrow bitmap. */ } return overlay_arrow_string_or_property (var); } @@ -29316,11 +29308,6 @@ Its value should be an ASCII acronym string, `hex-code', `empty-box', or DEFVAR_LISP ("debug-on-message", Vdebug_on_message, doc: /* If non-nil, debug if a message matching this regexp is displayed. */); Vdebug_on_message = Qnil; - - DEFVAR_LISP ("inhibit-debug-on-message", Vinhibit_debug_on_message, - doc: /* If non-nil, inhibit `debug-on-message' from entering the debugger. */); - Vinhibit_debug_on_message = Qnil; - DEFSYM(Qinhibit_debug_on_message, "inhibit-debug-on-message"); } |