diff options
| author | Lars Ingebrigtsen | 2022-05-01 13:40:13 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2022-05-01 13:40:13 +0200 |
| commit | 7c8bec9e1ffe087918f6f218fc4560fc968aebb2 (patch) | |
| tree | 2546ec6c38b293890826a0b93e2f66a2ea8f7e2f /doc | |
| parent | 81ce4b0e4ee18520f174cc5b46219e4475fcc956 (diff) | |
| download | emacs-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')
| -rw-r--r-- | doc/lispref/debugging.texi | 18 | ||||
| -rw-r--r-- | doc/lispref/edebug.texi | 8 |
2 files changed, 23 insertions, 3 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 | |||
| 196 | cause of a particular message. | 196 | cause of a particular message. |
| 197 | @end defvar | 197 | @end defvar |
| 198 | 198 | ||
| 199 | @defvar debug-allow-recursive-debug | ||
| 200 | You can evaluate forms in the current stack frame in the | ||
| 201 | @samp{*Backtrace*} buffer with the @key{e} command, and while | ||
| 202 | edebugging you can use the @key{e} and @key{C-x C-e} commands to do | ||
| 203 | something similar. By default, the debugger is inhibited by these | ||
| 204 | commands (because (re-)entering the debugger at this point will | ||
| 205 | usually 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 | ||
| 207 | these 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 |
| 200 | file, use the option @samp{--debug-init}. This binds | 211 | file, 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 |
| 521 | are set up to do so by @code{debug-on-entry}. | 532 | are set up to do so by @code{debug-on-entry}. |
| 522 | 533 | ||
| 534 | @vindex debug-allow-recursive-debug | ||
| 523 | @item e | 535 | @item e |
| 524 | Read a Lisp expression in the minibuffer, evaluate it (with the | 536 | Read a Lisp expression in the minibuffer, evaluate it (with the |
| 525 | relevant lexical environment, if applicable), and print the | 537 | relevant lexical environment, if applicable), and print the |
| @@ -528,7 +540,11 @@ variables, and the current buffer, as part of its operation; @kbd{e} | |||
| 528 | temporarily restores their values from outside the debugger, so you can | 540 | temporarily restores their values from outside the debugger, so you can |
| 529 | examine and change them. This makes the debugger more transparent. By | 541 | examine and change them. This makes the debugger more transparent. By |
| 530 | contrast, @kbd{M-:} does nothing special in the debugger; it shows you | 542 | contrast, @kbd{M-:} does nothing special in the debugger; it shows you |
| 531 | the variable values within the debugger. | 543 | the variable values within the debugger. By default, this command |
| 544 | suppresses the debugger during evaluation, so that an error in the | ||
| 545 | evaluated expression won't add a new error on top of the existing one. | ||
| 546 | Set the @code{debug-allow-recursive-debug} user option to a | ||
| 547 | non-@code{nil} value to override this. | ||
| 532 | 548 | ||
| 533 | @item R | 549 | @item R |
| 534 | Like @kbd{e}, but also save the result of evaluation in the | 550 | Like @kbd{e}, but also save the result of evaluation in the |
diff --git a/doc/lispref/edebug.texi b/doc/lispref/edebug.texi index eff9621628e..0fc5271d5ad 100644 --- a/doc/lispref/edebug.texi +++ b/doc/lispref/edebug.texi | |||
| @@ -700,8 +700,12 @@ on this process. | |||
| 700 | @table @kbd | 700 | @table @kbd |
| 701 | @item e @var{exp} @key{RET} | 701 | @item e @var{exp} @key{RET} |
| 702 | Evaluate expression @var{exp} in the context outside of Edebug | 702 | Evaluate expression @var{exp} in the context outside of Edebug |
| 703 | (@code{edebug-eval-expression}). That is, Edebug tries to minimize its | 703 | (@code{edebug-eval-expression}). That is, Edebug tries to minimize |
| 704 | interference with the evaluation. | 704 | its interference with the evaluation. By default, this command |
| 705 | suppresses the debugger during evaluation, so that an error in the | ||
| 706 | evaluated expression won't add a new error on top of the existing one. | ||
| 707 | Set the @code{debug-allow-recursive-debug} user option to a | ||
| 708 | non-@code{nil} value to override this. | ||
| 705 | 709 | ||
| 706 | @item M-: @var{exp} @key{RET} | 710 | @item M-: @var{exp} @key{RET} |
| 707 | Evaluate expression @var{exp} in the context of Edebug itself | 711 | Evaluate expression @var{exp} in the context of Edebug itself |