aboutsummaryrefslogtreecommitdiffstats
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorStefan Monnier2023-12-25 21:41:08 -0500
committerStefan Monnier2023-12-28 01:17:21 -0500
commit26b7078705ae5b9226c99e370740ab9a4063f20f (patch)
tree45f130466b1c6cddf5ae705a49e410979ac183a7 /src/keyboard.c
parentb925152bffce30abbd48361af6858cd45b785d84 (diff)
downloademacs-scratch/handler-bind.tar.gz
emacs-scratch/handler-bind.zip
(backtrace-on-redisplay-error): Use `handler-bind`scratch/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.
Diffstat (limited to '')
-rw-r--r--src/keyboard.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index f10e9fd79b7..447f8d5d4ff 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1167,9 +1167,10 @@ top_level_2 (void)
1167 encountering an error, to help with debugging. */ 1167 encountering an error, to help with debugging. */
1168 bool setup_handler = noninteractive; 1168 bool setup_handler = noninteractive;
1169 if (setup_handler) 1169 if (setup_handler)
1170 /* FIXME: Should we (re)use `list_of_error` from `xdisp.c`? */
1170 push_handler_bind (list1 (Qerror), Qdebug_early__handler, 0); 1171 push_handler_bind (list1 (Qerror), Qdebug_early__handler, 0);
1171 1172
1172 Lisp_Object res = Feval (Vtop_level, Qnil); 1173 Lisp_Object res = Feval (Vtop_level, Qt);
1173 1174
1174 if (setup_handler) 1175 if (setup_handler)
1175 pop_handler (); 1176 pop_handler ();
@@ -1365,7 +1366,6 @@ command_loop_1 (void)
1365 display_malloc_warning (); 1366 display_malloc_warning ();
1366 1367
1367 Vdeactivate_mark = Qnil; 1368 Vdeactivate_mark = Qnil;
1368 backtrace_yet = false;
1369 1369
1370 /* Don't ignore mouse movements for more than a single command 1370 /* Don't ignore mouse movements for more than a single command
1371 loop. (This flag is set in xdisp.c whenever the tool bar is 1371 loop. (This flag is set in xdisp.c whenever the tool bar is