summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2023-12-20 23:31:39 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2024-01-04 16:35:53 -0500
commit604e34338f3b5a31439020c6704f9f9d07d17d69 (patch)
tree6c174d866bb014b09705466158619d3e6654f236 /lisp/emacs-lisp
parent80b081a0ac72a5a9e459af6c96f5b0226a79894f (diff)
downloademacs-604e34338f3b5a31439020c6704f9f9d07d17d69.tar.gz
emacs-604e34338f3b5a31439020c6704f9f9d07d17d69.tar.bz2
emacs-604e34338f3b5a31439020c6704f9f9d07d17d69.zip
Move batch backtrace code to `top_level_2`
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.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/debug-early.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/debug-early.el b/lisp/emacs-lisp/debug-early.el
index f2eb8792bfa..464c2e96927 100644
--- a/lisp/emacs-lisp/debug-early.el
+++ b/lisp/emacs-lisp/debug-early.el
@@ -94,4 +94,8 @@ available before `debug' was usable.)"
(prin1 (cdr (car (cdr args)))) ; The error data.
(debug-early-backtrace)))
+(defalias 'debug-early--handler ;Called from C.
+ #'(lambda (err)
+ (if backtrace-on-error-noninteractive (debug-early 'error err))))
+
;;; debug-early.el ends here.