summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/debug-early.el
Commit message (Collapse)AuthorAgeFilesLines
* (debug--early): Avoid re-entering the debugger for the same errorStefan Monnier2025-03-061-6/+13
| | | | | | | | Fixes bug#76787. * lisp/emacs-lisp/debug.el (debugger--last-error): Move ... * lisp/emacs-lisp/debug-early.el (debugger--last-error): ... here. (debug--early): Use it.
* Update copyright year to 2025Paul Eggert2025-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* (backtrace-on-redisplay-error): Use `handler-bind`Stefan Monnier2024-01-041-25/+58
| | | | | | | | | | | | | | | | | | | | | | | | Reimplement `backtrace-on-redisplay-error` using `push_handler_bind`. This moves the code from `signal_or_quit` to `xdisp.c` and `debug-early.el`. * lisp/emacs-lisp/debug-early.el (debug-early-backtrace): Add `base` arg to strip "internal" frames. (debug--early): New function, extracted from `debug-early`. (debug-early, debug-early--handler): Use it. (debug-early--muted): New function, extracted (translated) from `signal_or_quit`; trim the buffer to a max of 10 backtraces. * src/xdisp.c (funcall_with_backtraces): New function. (dsafe_calln): Use it. (syms_of_xdisp): Defsym `Qdebug_early__muted`. * src/eval.c (redisplay_deep_handler): Delete var. (init_eval, internal_condition_case_n): Don't set it any more. (backtrace_yet): Delete var. (signal_or_quit): Remove special case for `backtrace_on_redisplay_error`. * src/keyboard.c (command_loop_1): Don't set `backtrace_yet` any more. * src/lisp.h (backtrace_yet): Don't declare.
* Move batch backtrace code to `top_level_2`Stefan Monnier2024-01-041-0/+4
| | | | | | | | | | | | | | | | | Move ad-hoc code meant to ease debugging of bootstrap (and batch mode) to `top_level_2` so it doesn't pollute `signal_or_quit`. * src/lisp.h (pop_handler, push_handler_bind): Declare. * src/keyboard.c (top_level_2): Setup an error handler to call `debug-early` when noninteractive. * src/eval.c (pop_handler): Not static any more. (signal_or_quit): Remove special case for noninteractive use. (push_handler_bind): New function, extracted from `Fhandler_bind_1`. (Fhandler_bind_1): Use it. (syms_of_eval): Declare `Qdebug_early__handler`. * lisp/emacs-lisp/debug-early.el (debug-early-backtrace): Weed out frames below `debug-early`. (debug-early--handler): New function.
* ; Add 2024 to copyright yearsPo Lu2024-01-021-1/+1
|
* * lisp/emacs-lisp/debug-early.el (debug-early-backtrace): Fix bug#61847Stefan Monnier2023-03-011-4/+4
| | | | | | | The `noerror` arg of `require` doesn't do what Stefan naively thought when he wrote this code, so use `condition-case` instead. Also check for `cl-defmethod` since `cl-prin1` can't be loaded before that anyway.
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-011-1/+1
|
* Make debug-early-backtrace more resilientLars Ingebrigtsen2022-06-241-1/+7
| | | | | * lisp/emacs-lisp/debug-early.el (debug-early-backtrace): Allow outputting backtraces during bootstrap.
* debug-early: Print bytecode in a more manageable wayStefan Monnier2022-04-291-20/+24
| | | | | | * lisp/emacs-lisp/debug-early.el (debug-early-backtrace): Escape newlines to and bytecodes to make backtraces slightly more readable. Use `cl-prin1` when available.
* Fix eval-tests/backtrace-in-batch-mode testStefan Monnier2022-02-061-4/+5
| | | | | * lisp/emacs-lisp/debug-early.el (debug-early-backtrace): Fix the zero-arg case.
* (debug-early-backtrace): Tweak the non-evald outputStefan Monnier2022-02-061-0/+2
| | | | | * lisp/emacs-lisp/debug-early.el (debug-early-backtrace): Make the non-evald output more like what is used in `debug.el`.
* (debug-early-backtrace): Tweak the non-evald outputStefan Monnier2022-02-061-12/+9
| | | | | * lisp/emacs-lisp/debug-early.el (debug-early-backtrace): Make the non-evald output more like what is used in `debug.el`.
* * lisp/emacs-lisp/debug-early.el: Improve the documentationAlan Mackenzie2022-02-051-9/+19
|
* New file lisp/emacs-lisp/debug-early.el for backtraces in early bootstrapAlan Mackenzie2022-02-021-0/+77
This is also used in batch mode in general. * lisp/debug-early.el (debug-early-backtrace, debug-early): New functions. * lisp/loadup.el (top level): Load debug-early.el as first file. * src/eval.c (signal_or_quit): Remove the condition in the batch mode section of not being in dumping or bootstrap, since it is no longer needed. Test that 'debug-early's symbol-function is bound. Ensure there is enough working space in specpdl and eval_depth. (syms_of_eval): New DEFSYM for Qdebug_early. Initialise Vdebugger to Qdebug_early rather than Qnil.