(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.
** New error type and new function `user-error'. Doesn't trigger the debugger.
-** New option `debugger-bury-or-kill'.
+** Debugger
+*** New option `debugger-bury-or-kill'.
+
+*** Set `debug-on-message' to enter the debugger when a certain
+message is displayed in the echo area. This can be useful when trying
+to work out which code is doing something.
+
+*** New var `inhibit-debugger', automatically set to prevent accidental
+recursive invocations.
+++
** New utility function `buffer-narrowed-p'.
*** Set `debug-on-event' to enter the debugger on events like SIGUSR1.
This can be useful when `inhibit-quit' is set.
-*** Set `debug-on-message' to enter the debugger when a certain
-message is displayed in the echo area. This can be useful when trying
-to work out which code is doing something.
-
** The new function `server-eval-at' allows evaluation of Lisp forms on
named Emacs server instances.
+2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/debug.el (debug): Don't bind debug-on-error since
+ inhibit-debugger is bound instead.
+
2012-09-11 Bastien Guerry <bzg@gnu.org>
* subr.el (set-temporary-overlay-map): Add a docstring.
2012-09-10 Dan Nicolaescu <dann@gnu.org>
- * vc/diff-mode.el (diff-mode-menu): Bind
- diff-remove-trailing-whitespace.
+ * vc/diff-mode.el (diff-mode-menu):
+ Bind diff-remove-trailing-whitespace.
2012-09-10 Stefan Monnier <monnier@iro.umontreal.ca>
(unless noninteractive
(message "Entering debugger..."))
(let (debugger-value
- (debug-on-error nil)
- (debug-on-quit nil)
(debugger-previous-state
(if (get-buffer "*Backtrace*")
(with-current-buffer (get-buffer "*Backtrace*")
+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.
&& (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) \
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;
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. */
/* 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
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");
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
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,
*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;
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);
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
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)));
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));
}
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);
}
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");
}