diff options
| author | Gemini Lasswell | 2018-06-19 07:27:41 -0700 |
|---|---|---|
| committer | Gemini Lasswell | 2018-08-03 08:53:02 -0700 |
| commit | e09120d68694272ea5efbe13b16936b4382389d8 (patch) | |
| tree | 99f072a54e22202ee74969370722564a519e27a7 /doc/misc | |
| parent | 8a7620955b4d859caecd9a5dc9f2a986baf994fd (diff) | |
| download | emacs-e09120d68694272ea5efbe13b16936b4382389d8.tar.gz emacs-e09120d68694272ea5efbe13b16936b4382389d8.zip | |
Add backtrace-mode and use it in the debugger, ERT and Edebug
* doc/lispref/debugging.texi (Using Debugger): Remove explanation of
backtrace buffer. Refer to new node.
(Backtraces): New node.
(Debugger Commands): Refer to new node. Remove 'v'.
* doc/lispref/edebug.texi (Edebug Misc): Refer to new node.
* doc/misc/ert.texi (Running Tests Interactively): Refer to new node.
* lisp/emacs-lisp-backtrace.el: New file.
* test/lisp/emacs-lisp/backtrace-tests.el: New file.
* lisp/emacs-lisp/debug.el: (debugger-buffer-state): New cl-defstruct.
(debugger--restore-buffer-state): New function.
(debug): Use a debugger-buffer-state object to save and restore buffer
state. Fix bug#15749 by leaving an unused buffer in debugger-mode,
empty, instead of in fundamental-mode, and then when reusing a buffer,
not calling debugger-mode if the buffer is already in debugger-mode.
(debugger-insert-backtrace): Remove.
(debugger-setup-buffer): Use backtrace-mode.
(debugger--insert-header): New function.
(debugger-continue, debugger-return-value): Change check for flags to
use backtrace-frames.
(debugger-frame-number): Determine backtrace frame number from
backtrace-frames.
(debugger--locals-visible-p, debugger--insert-locals)
(debugger--show-locals, debugger--hide-locals)
(debugger-toggle-locals): Remove.
(debugger-mode-map): Make a child of backtrace-mode-map. Move
navigation commands to backtrace-mode-map. Bind 'q' to debugger-quit
instead of top-level. Make Help Follow menu item call
backtrace-help-follow-symbol.
(debugger-mode): Derive from backtrace-mode.
(debug-help-follow): Remove. Move body of this function to
'backtrace-help-follow-symbol' in backtrace.el.
(debugger-quit): New function.
* lisp/emacs-lisp/edebug.el (edebug-unwrap-results): Remove warning
in docstring about circular results.
(edebug-unwrap): Use pcase.
(edebug-unwrap1): New function to unwrap circular objects.
(edebug-unwrap*): Use it.
(edebug--frame): New cl-defstruct.
(edebug-backtrace): Call the buffer *Edebug Backtrace* and use
backtrace-mode. Get the frames from edebug--backtrace-frames.
(edebug--backtrace-frames, edebug--unwrap-and-add-info)
(edebug--symbol-not-prefixed-p): New functions.
* lisp/emacs-lisp/lisp-mode.el
(lisp-el-font-lock-keywords-for-backtraces)
(lisp-el-font-lock-keywords-for-backtraces-1)
(lisp-el-font-lock-keywords-for-backtraces-2): New constants.
* lisp/emacs-lisp/ert.el (ert--print-backtrace): Remove.
(ert--run-test-debugger): Use backtrace-get-frames.
(ert-run-tests-batch): Use backtrace-to-string.
(ert-results-pop-to-backtrace-for-test-at-point): Use backtrace-mode.
(ert--insert-backtrace-header): New function.
* tests/lisp/emacs-lisp/ert-tests.el (ert-test--which-file):
Use backtrace-frame slot accessor.
Diffstat (limited to 'doc/misc')
| -rw-r--r-- | doc/misc/ert.texi | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi index 82e0e27ed1c..e2aeeb1353a 100644 --- a/doc/misc/ert.texi +++ b/doc/misc/ert.texi | |||
| @@ -273,9 +273,11 @@ moving point to it and typing @kbd{@key{RET}} jumps to its definition. | |||
| 273 | @cindex backtrace of a failed test | 273 | @cindex backtrace of a failed test |
| 274 | Pressing @kbd{r} re-runs the test near point on its own. Pressing | 274 | Pressing @kbd{r} re-runs the test near point on its own. Pressing |
| 275 | @kbd{d} re-runs it with the debugger enabled. @kbd{.} jumps to the | 275 | @kbd{d} re-runs it with the debugger enabled. @kbd{.} jumps to the |
| 276 | definition of the test near point (@kbd{@key{RET}} has the same effect if | 276 | definition of the test near point (@kbd{@key{RET}} has the same effect |
| 277 | point is on the name of the test). On a failed test, @kbd{b} shows | 277 | if point is on the name of the test). On a failed test, @kbd{b} shows |
| 278 | the backtrace of the failure. | 278 | the backtrace of the failure. @xref{Debugging,, Backtraces, elisp, |
| 279 | the Emacs Lisp Reference Manual}, for more information about | ||
| 280 | backtraces. | ||
| 279 | 281 | ||
| 280 | @kindex l@r{, in ert results buffer} | 282 | @kindex l@r{, in ert results buffer} |
| 281 | @kbd{l} shows the list of @code{should} forms executed in the test. | 283 | @kbd{l} shows the list of @code{should} forms executed in the test. |