From 7f7e0167cf664f2d66ac3fa8a7301e05f09883d2 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 4 Sep 2012 23:21:00 +0200 Subject: Implement `debug-on-message'. This allows tracking down what piece of code is outputting stuff in the echo area. * eval.c (call_debugger): Make the function non-static so that we can call it from set_message. * xdisp.c (set_message): Implement the new variable `debug-on-message'. (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'. --- doc/lispref/ChangeLog | 4 ++++ doc/lispref/debugging.texi | 5 +++++ 2 files changed, 9 insertions(+) (limited to 'doc/lispref') diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index b0156e5ac7e..50f9853b7eb 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,7 @@ +2012-09-04 Lars Ingebrigtsen + + * debugging.texi (Explicit Debug): Document `debug-on-message'. + 2012-09-02 Chong Yidong * windows.texi (Window Configurations): Recommend against using diff --git a/doc/lispref/debugging.texi b/doc/lispref/debugging.texi index 00e8d84e9b3..5aeff576d09 100644 --- a/doc/lispref/debugging.texi +++ b/doc/lispref/debugging.texi @@ -298,6 +298,11 @@ of @code{(debug)} isn't ignored, it will alter the execution of the program!) The most common suitable places are inside a @code{progn} or an implicit @code{progn} (@pxref{Sequencing}). + If you don't know exactly where in the source code you want to put +the debug statement, but you want to display a backtrace when a +certain message is displayed, you can set @code{debug-on-message} to a +regular expression matching the desired message. + @node Using Debugger @subsection Using the Debugger -- cgit v1.2.1