aboutsummaryrefslogtreecommitdiffstats
path: root/doc/lispref/debugging.texi
diff options
context:
space:
mode:
authorLars Ingebrigtsen2022-05-01 13:40:13 +0200
committerLars Ingebrigtsen2022-05-01 13:40:13 +0200
commit7c8bec9e1ffe087918f6f218fc4560fc968aebb2 (patch)
tree2546ec6c38b293890826a0b93e2f66a2ea8f7e2f /doc/lispref/debugging.texi
parent81ce4b0e4ee18520f174cc5b46219e4475fcc956 (diff)
downloademacs-7c8bec9e1ffe087918f6f218fc4560fc968aebb2.tar.gz
emacs-7c8bec9e1ffe087918f6f218fc4560fc968aebb2.zip
Don't enter the debugger from *Backtrace* or edebug on eval errors
* doc/lispref/debugging.texi (Error Debugging): Document it. * doc/lispref/edebug.texi (Edebug Eval): Mention it. * lisp/emacs-lisp/debug.el (debug-allow-recursive-debug): New user option (bug#36145). (debugger-eval-expression): Use it. * lisp/emacs-lisp/edebug.el (edebug-eval-expression): Ditto. This patch is based on a patch by Noam Postavsky.
Diffstat (limited to 'doc/lispref/debugging.texi')
-rw-r--r--doc/lispref/debugging.texi18
1 files changed, 17 insertions, 1 deletions
diff --git a/doc/lispref/debugging.texi b/doc/lispref/debugging.texi
index c258a9adc0e..058c9319544 100644
--- a/doc/lispref/debugging.texi
+++ b/doc/lispref/debugging.texi
@@ -196,6 +196,17 @@ echo area. For example, this can be useful when trying to find the
196cause of a particular message. 196cause of a particular message.
197@end defvar 197@end defvar
198 198
199@defvar debug-allow-recursive-debug
200You can evaluate forms in the current stack frame in the
201@samp{*Backtrace*} buffer with the @key{e} command, and while
202edebugging you can use the @key{e} and @key{C-x C-e} commands to do
203something similar. By default, the debugger is inhibited by these
204commands (because (re-)entering the debugger at this point will
205usually take you out of the debugging context you're in). Set
206@code{debug-allow-recursive-debug} to a non-@code{nil} value to allow
207these commands to enter the debugger recursively.
208@end defvar
209
199 To debug an error that happens during loading of the init 210 To debug an error that happens during loading of the init
200file, use the option @samp{--debug-init}. This binds 211file, use the option @samp{--debug-init}. This binds
201@code{debug-on-error} to @code{t} while loading the init file, and 212@code{debug-on-error} to @code{t} while loading the init file, and
@@ -520,6 +531,7 @@ Flag the current frame like @kbd{b}. Then continue execution like
520@kbd{c}, but temporarily disable break-on-entry for all functions that 531@kbd{c}, but temporarily disable break-on-entry for all functions that
521are set up to do so by @code{debug-on-entry}. 532are set up to do so by @code{debug-on-entry}.
522 533
534@vindex debug-allow-recursive-debug
523@item e 535@item e
524Read a Lisp expression in the minibuffer, evaluate it (with the 536Read a Lisp expression in the minibuffer, evaluate it (with the
525relevant lexical environment, if applicable), and print the 537relevant lexical environment, if applicable), and print the
@@ -528,7 +540,11 @@ variables, and the current buffer, as part of its operation; @kbd{e}
528temporarily restores their values from outside the debugger, so you can 540temporarily restores their values from outside the debugger, so you can
529examine and change them. This makes the debugger more transparent. By 541examine and change them. This makes the debugger more transparent. By
530contrast, @kbd{M-:} does nothing special in the debugger; it shows you 542contrast, @kbd{M-:} does nothing special in the debugger; it shows you
531the variable values within the debugger. 543the variable values within the debugger. By default, this command
544suppresses the debugger during evaluation, so that an error in the
545evaluated expression won't add a new error on top of the existing one.
546Set the @code{debug-allow-recursive-debug} user option to a
547non-@code{nil} value to override this.
532 548
533@item R 549@item R
534Like @kbd{e}, but also save the result of evaluation in the 550Like @kbd{e}, but also save the result of evaluation in the