]> git.eshelyaron.com Git - emacs.git/commit
(backtrace-on-redisplay-error): Use `handler-bind`
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 26 Dec 2023 02:41:08 +0000 (21:41 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 4 Jan 2024 21:37:01 +0000 (16:37 -0500)
commit391c208aecc44fd82c599696d47a18782f2f36da
tree3f1cb5a99208c18e4290ca8f864f2148c12fdf3c
parent2ef6e40da88d5b4f070e339a2210f5751ab6a7cb
(backtrace-on-redisplay-error): Use `handler-bind`

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.
lisp/emacs-lisp/debug-early.el
src/eval.c
src/keyboard.c
src/lisp.h
src/xdisp.c