diff options
| author | Karoly Lorentey | 2006-07-29 18:41:57 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2006-07-29 18:41:57 +0000 |
| commit | e6aee454e682e137d5b04116716d308c1d5c3544 (patch) | |
| tree | 2dd86fbdc8e51e61645c3167c9c5f5f6dd4ad8c7 /src | |
| parent | d7a0175d426200fb931fa5e5ded5b890726ecd23 (diff) | |
| download | emacs-e6aee454e682e137d5b04116716d308c1d5c3544.tar.gz emacs-e6aee454e682e137d5b04116716d308c1d5c3544.zip | |
Fix x_catch_errors-related abort after X disconnects. (Reported by Dan Nicolaescu).
* src/xterm.h: Remove declaration for x_fully_uncatch_errors.
* src/xterm.c (x_fully_uncatch_errors): Disable definition.
* src/eval.c (unwind_to_catch): Don't call x_fully_uncatch_errors.
(internal_condition_case, internal_condition_case_1)
(internal_condition_case_2): Don't abort when x_catching_errors.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-576
Diffstat (limited to 'src')
| -rw-r--r-- | src/eval.c | 10 | ||||
| -rw-r--r-- | src/xterm.c | 3 | ||||
| -rw-r--r-- | src/xterm.h | 1 |
3 files changed, 13 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c index 0d7a6a31038..c8ad9004c44 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -1261,8 +1261,12 @@ unwind_to_catch (catch, value) | |||
| 1261 | #if HAVE_X_WINDOWS | 1261 | #if HAVE_X_WINDOWS |
| 1262 | /* If x_catch_errors was done, turn it off now. | 1262 | /* If x_catch_errors was done, turn it off now. |
| 1263 | (First we give unbind_to a chance to do that.) */ | 1263 | (First we give unbind_to a chance to do that.) */ |
| 1264 | #if 0 /* This would disable x_catch_errors after x_connection_closed. | ||
| 1265 | * The catch must remain in effect during that delicate | ||
| 1266 | * state. --lorentey */ | ||
| 1264 | x_fully_uncatch_errors (); | 1267 | x_fully_uncatch_errors (); |
| 1265 | #endif | 1268 | #endif |
| 1269 | #endif | ||
| 1266 | 1270 | ||
| 1267 | byte_stack_list = catch->byte_stack; | 1271 | byte_stack_list = catch->byte_stack; |
| 1268 | gcprolist = catch->gcpro; | 1272 | gcprolist = catch->gcpro; |
| @@ -1439,10 +1443,12 @@ internal_condition_case (bfun, handlers, hfun) | |||
| 1439 | 1443 | ||
| 1440 | /* Since Fsignal will close off all calls to x_catch_errors, | 1444 | /* Since Fsignal will close off all calls to x_catch_errors, |
| 1441 | we will get the wrong results if some are not closed now. */ | 1445 | we will get the wrong results if some are not closed now. */ |
| 1446 | #if 0 /* Fsignal doesn't do that anymore. --lorentey */ | ||
| 1442 | #if HAVE_X_WINDOWS | 1447 | #if HAVE_X_WINDOWS |
| 1443 | if (x_catching_errors ()) | 1448 | if (x_catching_errors ()) |
| 1444 | abort (); | 1449 | abort (); |
| 1445 | #endif | 1450 | #endif |
| 1451 | #endif | ||
| 1446 | 1452 | ||
| 1447 | c.tag = Qnil; | 1453 | c.tag = Qnil; |
| 1448 | c.val = Qnil; | 1454 | c.val = Qnil; |
| @@ -1487,10 +1493,12 @@ internal_condition_case_1 (bfun, arg, handlers, hfun) | |||
| 1487 | 1493 | ||
| 1488 | /* Since Fsignal will close off all calls to x_catch_errors, | 1494 | /* Since Fsignal will close off all calls to x_catch_errors, |
| 1489 | we will get the wrong results if some are not closed now. */ | 1495 | we will get the wrong results if some are not closed now. */ |
| 1496 | #if 0 /* Fsignal doesn't do that anymore. --lorentey */ | ||
| 1490 | #if HAVE_X_WINDOWS | 1497 | #if HAVE_X_WINDOWS |
| 1491 | if (x_catching_errors ()) | 1498 | if (x_catching_errors ()) |
| 1492 | abort (); | 1499 | abort (); |
| 1493 | #endif | 1500 | #endif |
| 1501 | #endif | ||
| 1494 | 1502 | ||
| 1495 | c.tag = Qnil; | 1503 | c.tag = Qnil; |
| 1496 | c.val = Qnil; | 1504 | c.val = Qnil; |
| @@ -1538,10 +1546,12 @@ internal_condition_case_2 (bfun, nargs, args, handlers, hfun) | |||
| 1538 | 1546 | ||
| 1539 | /* Since Fsignal will close off all calls to x_catch_errors, | 1547 | /* Since Fsignal will close off all calls to x_catch_errors, |
| 1540 | we will get the wrong results if some are not closed now. */ | 1548 | we will get the wrong results if some are not closed now. */ |
| 1549 | #if 0 /* Fsignal doesn't do that anymore. --lorentey */ | ||
| 1541 | #if HAVE_X_WINDOWS | 1550 | #if HAVE_X_WINDOWS |
| 1542 | if (x_catching_errors ()) | 1551 | if (x_catching_errors ()) |
| 1543 | abort (); | 1552 | abort (); |
| 1544 | #endif | 1553 | #endif |
| 1554 | #endif | ||
| 1545 | 1555 | ||
| 1546 | c.tag = Qnil; | 1556 | c.tag = Qnil; |
| 1547 | c.val = Qnil; | 1557 | c.val = Qnil; |
diff --git a/src/xterm.c b/src/xterm.c index 9c0b25b08bf..5df7896a2b3 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -7615,6 +7615,8 @@ x_clear_errors (dpy) | |||
| 7615 | x_error_message->string[0] = 0; | 7615 | x_error_message->string[0] = 0; |
| 7616 | } | 7616 | } |
| 7617 | 7617 | ||
| 7618 | #if 0 /* See comment in unwind_to_catch why calling this is a bad | ||
| 7619 | * idea. --lorentey */ | ||
| 7618 | /* Close off all unclosed x_catch_errors calls. */ | 7620 | /* Close off all unclosed x_catch_errors calls. */ |
| 7619 | 7621 | ||
| 7620 | void | 7622 | void |
| @@ -7623,6 +7625,7 @@ x_fully_uncatch_errors () | |||
| 7623 | while (x_error_message) | 7625 | while (x_error_message) |
| 7624 | x_uncatch_errors (); | 7626 | x_uncatch_errors (); |
| 7625 | } | 7627 | } |
| 7628 | #endif | ||
| 7626 | 7629 | ||
| 7627 | /* Nonzero if x_catch_errors has been done and not yet canceled. */ | 7630 | /* Nonzero if x_catch_errors has been done and not yet canceled. */ |
| 7628 | 7631 | ||
diff --git a/src/xterm.h b/src/xterm.h index 4580f3c0744..6bbcdc6389d 100644 --- a/src/xterm.h +++ b/src/xterm.h | |||
| @@ -975,7 +975,6 @@ extern int x_had_errors_p P_ ((Display *)); | |||
| 975 | extern int x_catching_errors P_ ((void)); | 975 | extern int x_catching_errors P_ ((void)); |
| 976 | extern void x_uncatch_errors P_ ((void)); | 976 | extern void x_uncatch_errors P_ ((void)); |
| 977 | extern void x_clear_errors P_ ((Display *)); | 977 | extern void x_clear_errors P_ ((Display *)); |
| 978 | extern void x_fully_uncatch_errors P_ ((void)); | ||
| 979 | extern void x_set_window_size P_ ((struct frame *, int, int, int)); | 978 | extern void x_set_window_size P_ ((struct frame *, int, int, int)); |
| 980 | extern void x_set_mouse_position P_ ((struct frame *, int, int)); | 979 | extern void x_set_mouse_position P_ ((struct frame *, int, int)); |
| 981 | extern void x_set_mouse_pixel_position P_ ((struct frame *, int, int)); | 980 | extern void x_set_mouse_pixel_position P_ ((struct frame *, int, int)); |