aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman2002-12-21 18:05:00 +0000
committerRichard M. Stallman2002-12-21 18:05:00 +0000
commit2659a09fb81fbf77dc75766d621aff0ba1c463e4 (patch)
tree8af981eb6e03c5bfe4f51bf06415a9258e4c3793 /src
parent6b381c3ac9e4f98148449868fa41c6b344f8413d (diff)
downloademacs-2659a09fb81fbf77dc75766d621aff0ba1c463e4.tar.gz
emacs-2659a09fb81fbf77dc75766d621aff0ba1c463e4.zip
Errors and throws work right with interrupt blocking.
(struct catchtag): New elt interrupt_input_blocked. (unwind_to_catch): Restore interrupt_input_blocked from saved value. (internal_catch, Fcondition_case, internal_condition_case) (internal_condition_case_1, internal_condition_case_2): Save it. (Fsignal): Don't do TOTALLY_UNBLOCK_INPUT.
Diffstat (limited to 'src')
-rw-r--r--src/eval.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/eval.c b/src/eval.c
index 7d8434ae78d..1bb7cb809f9 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -77,6 +77,7 @@ struct catchtag
77 int lisp_eval_depth; 77 int lisp_eval_depth;
78 int pdlcount; 78 int pdlcount;
79 int poll_suppress_count; 79 int poll_suppress_count;
80 int interrupt_input_blocked;
80 struct byte_stack *byte_stack; 81 struct byte_stack *byte_stack;
81}; 82};
82 83
@@ -1103,6 +1104,7 @@ internal_catch (tag, func, arg)
1103 c.lisp_eval_depth = lisp_eval_depth; 1104 c.lisp_eval_depth = lisp_eval_depth;
1104 c.pdlcount = SPECPDL_INDEX (); 1105 c.pdlcount = SPECPDL_INDEX ();
1105 c.poll_suppress_count = poll_suppress_count; 1106 c.poll_suppress_count = poll_suppress_count;
1107 c.interrupt_input_blocked = interrupt_input_blocked;
1106 c.gcpro = gcprolist; 1108 c.gcpro = gcprolist;
1107 c.byte_stack = byte_stack_list; 1109 c.byte_stack = byte_stack_list;
1108 catchlist = &c; 1110 catchlist = &c;
@@ -1144,6 +1146,7 @@ unwind_to_catch (catch, value)
1144 1146
1145 /* Restore the polling-suppression count. */ 1147 /* Restore the polling-suppression count. */
1146 set_poll_suppress_count (catch->poll_suppress_count); 1148 set_poll_suppress_count (catch->poll_suppress_count);
1149 interrupt_input_blocked = catch->interrupt_input_blocked;
1147 1150
1148 do 1151 do
1149 { 1152 {
@@ -1270,6 +1273,7 @@ usage: (condition-case VAR BODYFORM HANDLERS...) */)
1270 c.lisp_eval_depth = lisp_eval_depth; 1273 c.lisp_eval_depth = lisp_eval_depth;
1271 c.pdlcount = SPECPDL_INDEX (); 1274 c.pdlcount = SPECPDL_INDEX ();
1272 c.poll_suppress_count = poll_suppress_count; 1275 c.poll_suppress_count = poll_suppress_count;
1276 c.interrupt_input_blocked = interrupt_input_blocked;
1273 c.gcpro = gcprolist; 1277 c.gcpro = gcprolist;
1274 c.byte_stack = byte_stack_list; 1278 c.byte_stack = byte_stack_list;
1275 if (_setjmp (c.jmp)) 1279 if (_setjmp (c.jmp))
@@ -1319,12 +1323,8 @@ internal_condition_case (bfun, handlers, hfun)
1319 struct catchtag c; 1323 struct catchtag c;
1320 struct handler h; 1324 struct handler h;
1321 1325
1322#if 0 /* Can't do this check anymore because realize_basic_faces has 1326#if 0 /* We now handle interrupt_input_blocked properly.
1323 to BLOCK_INPUT, and can call Lisp. What's really needed is a 1327 What we still do not handle is exiting a signal handler. */
1324 flag indicating that we're currently handling a signal. */
1325 /* Since Fsignal resets this to 0, it had better be 0 now
1326 or else we have a potential bug. */
1327 if (interrupt_input_blocked != 0)
1328 abort (); 1328 abort ();
1329#endif 1329#endif
1330 1330
@@ -1335,6 +1335,7 @@ internal_condition_case (bfun, handlers, hfun)
1335 c.lisp_eval_depth = lisp_eval_depth; 1335 c.lisp_eval_depth = lisp_eval_depth;
1336 c.pdlcount = SPECPDL_INDEX (); 1336 c.pdlcount = SPECPDL_INDEX ();
1337 c.poll_suppress_count = poll_suppress_count; 1337 c.poll_suppress_count = poll_suppress_count;
1338 c.interrupt_input_blocked = interrupt_input_blocked;
1338 c.gcpro = gcprolist; 1339 c.gcpro = gcprolist;
1339 c.byte_stack = byte_stack_list; 1340 c.byte_stack = byte_stack_list;
1340 if (_setjmp (c.jmp)) 1341 if (_setjmp (c.jmp))
@@ -1355,7 +1356,7 @@ internal_condition_case (bfun, handlers, hfun)
1355 return val; 1356 return val;
1356} 1357}
1357 1358
1358/* Like internal_condition_case but call HFUN with ARG as its argument. */ 1359/* Like internal_condition_case but call BFUN with ARG as its argument. */
1359 1360
1360Lisp_Object 1361Lisp_Object
1361internal_condition_case_1 (bfun, arg, handlers, hfun) 1362internal_condition_case_1 (bfun, arg, handlers, hfun)
@@ -1375,6 +1376,7 @@ internal_condition_case_1 (bfun, arg, handlers, hfun)
1375 c.lisp_eval_depth = lisp_eval_depth; 1376 c.lisp_eval_depth = lisp_eval_depth;
1376 c.pdlcount = SPECPDL_INDEX (); 1377 c.pdlcount = SPECPDL_INDEX ();
1377 c.poll_suppress_count = poll_suppress_count; 1378 c.poll_suppress_count = poll_suppress_count;
1379 c.interrupt_input_blocked = interrupt_input_blocked;
1378 c.gcpro = gcprolist; 1380 c.gcpro = gcprolist;
1379 c.byte_stack = byte_stack_list; 1381 c.byte_stack = byte_stack_list;
1380 if (_setjmp (c.jmp)) 1382 if (_setjmp (c.jmp))
@@ -1396,7 +1398,7 @@ internal_condition_case_1 (bfun, arg, handlers, hfun)
1396} 1398}
1397 1399
1398 1400
1399/* Like internal_condition_case but call HFUN with NARGS as first, 1401/* Like internal_condition_case but call BFUN with NARGS as first,
1400 and ARGS as second argument. */ 1402 and ARGS as second argument. */
1401 1403
1402Lisp_Object 1404Lisp_Object
@@ -1418,6 +1420,7 @@ internal_condition_case_2 (bfun, nargs, args, handlers, hfun)
1418 c.lisp_eval_depth = lisp_eval_depth; 1420 c.lisp_eval_depth = lisp_eval_depth;
1419 c.pdlcount = SPECPDL_INDEX (); 1421 c.pdlcount = SPECPDL_INDEX ();
1420 c.poll_suppress_count = poll_suppress_count; 1422 c.poll_suppress_count = poll_suppress_count;
1423 c.interrupt_input_blocked = interrupt_input_blocked;
1421 c.gcpro = gcprolist; 1424 c.gcpro = gcprolist;
1422 c.byte_stack = byte_stack_list; 1425 c.byte_stack = byte_stack_list;
1423 if (_setjmp (c.jmp)) 1426 if (_setjmp (c.jmp))
@@ -1474,8 +1477,6 @@ See also the function `condition-case'. */)
1474 if (gc_in_progress || waiting_for_input) 1477 if (gc_in_progress || waiting_for_input)
1475 abort (); 1478 abort ();
1476 1479
1477 TOTALLY_UNBLOCK_INPUT;
1478
1479 if (NILP (error_symbol)) 1480 if (NILP (error_symbol))
1480 real_error_symbol = Fcar (data); 1481 real_error_symbol = Fcar (data);
1481 else 1482 else