Mercurial > emacs
comparison src/xterm.c @ 69173:fdee8318ddc9
* xterm.h, xterm.c (x_uncatch_errors): Delete unneccessary
argument.
* xterm.c: (x_load_font, x_term_init, XTmouse_position)
(handle_one_xevent, x_connection_closed, x_list_fonts): No arg for
x_uncatch_errors.
* xselect.c (x_own_selection, x_decline_selection_request)
(x_reply_selection_request, x_get_foreign_selection)
(Fx_get_atom_name, Fx_send_client_event): Likewise.
* xfns.c (x_real_positions, x_set_mouse_color, Fx_focus_frame):
Likewise.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Mon, 27 Feb 2006 03:35:31 +0000 |
parents | f2147c1027b6 |
children | 0adb2f38bc3d 8976b9f5eda1 5754737d1e04 |
comparison
equal
deleted
inserted
replaced
69172:e22243af3267 | 69173:fdee8318ddc9 |
---|---|
323 static void x_update_window_end P_ ((struct window *, int, int)); | 323 static void x_update_window_end P_ ((struct window *, int, int)); |
324 void x_delete_display P_ ((struct x_display_info *)); | 324 void x_delete_display P_ ((struct x_display_info *)); |
325 | 325 |
326 static int x_io_error_quitter P_ ((Display *)); | 326 static int x_io_error_quitter P_ ((Display *)); |
327 void x_catch_errors P_ ((Display *)); | 327 void x_catch_errors P_ ((Display *)); |
328 void x_uncatch_errors P_ ((Display *)); | 328 void x_uncatch_errors P_ ((void)); |
329 void x_lower_frame P_ ((struct frame *)); | 329 void x_lower_frame P_ ((struct frame *)); |
330 void x_scroll_bar_clear P_ ((struct frame *)); | 330 void x_scroll_bar_clear P_ ((struct frame *)); |
331 int x_had_errors_p P_ ((Display *)); | 331 int x_had_errors_p P_ ((Display *)); |
332 void x_wm_set_size_hint P_ ((struct frame *, long, int)); | 332 void x_wm_set_size_hint P_ ((struct frame *, long, int)); |
333 void x_raise_frame P_ ((struct frame *)); | 333 void x_raise_frame P_ ((struct frame *)); |
3793 } | 3793 } |
3794 | 3794 |
3795 if (x_had_errors_p (FRAME_X_DISPLAY (*fp))) | 3795 if (x_had_errors_p (FRAME_X_DISPLAY (*fp))) |
3796 f1 = 0; | 3796 f1 = 0; |
3797 | 3797 |
3798 x_uncatch_errors (FRAME_X_DISPLAY (*fp)); | 3798 x_uncatch_errors (); |
3799 | 3799 |
3800 /* If not, is it one of our scroll bars? */ | 3800 /* If not, is it one of our scroll bars? */ |
3801 if (! f1) | 3801 if (! f1) |
3802 { | 3802 { |
3803 struct scroll_bar *bar; | 3803 struct scroll_bar *bar; |
5719 RevertToParent, | 5719 RevertToParent, |
5720 event.xclient.data.l[1]); | 5720 event.xclient.data.l[1]); |
5721 /* This is needed to detect the error | 5721 /* This is needed to detect the error |
5722 if there is an error. */ | 5722 if there is an error. */ |
5723 XSync (d, False); | 5723 XSync (d, False); |
5724 x_uncatch_errors (d); | 5724 x_uncatch_errors (); |
5725 } | 5725 } |
5726 /* Not certain about handling scroll bars here */ | 5726 /* Not certain about handling scroll bars here */ |
5727 #endif /* 0 */ | 5727 #endif /* 0 */ |
5728 goto done; | 5728 goto done; |
5729 } | 5729 } |
7527 | 7527 |
7528 /* Undo the last x_catch_errors call. | 7528 /* Undo the last x_catch_errors call. |
7529 DPY should be the display that was passed to x_catch_errors. */ | 7529 DPY should be the display that was passed to x_catch_errors. */ |
7530 | 7530 |
7531 void | 7531 void |
7532 x_uncatch_errors (dpy) | 7532 x_uncatch_errors () |
7533 Display *dpy; | |
7534 { | 7533 { |
7535 struct x_error_message_stack *tmp; | 7534 struct x_error_message_stack *tmp; |
7536 | |
7537 eassert (x_error_message && dpy == x_error_message->dpy); | |
7538 | 7535 |
7539 /* The display may have been closed before this function is called. | 7536 /* The display may have been closed before this function is called. |
7540 Check if it is still open before calling XSync. */ | 7537 Check if it is still open before calling XSync. */ |
7541 if (x_display_info_for_display (dpy) != 0) | 7538 if (x_display_info_for_display (x_error_message->dpy) != 0) |
7542 { | 7539 { |
7543 BLOCK_INPUT; | 7540 BLOCK_INPUT; |
7544 XSync (dpy, False); | 7541 XSync (x_error_message->dpy, False); |
7545 UNBLOCK_INPUT; | 7542 UNBLOCK_INPUT; |
7546 } | 7543 } |
7547 | 7544 |
7548 tmp = x_error_message; | 7545 tmp = x_error_message; |
7549 x_error_message = x_error_message->prev; | 7546 x_error_message = x_error_message->prev; |
7564 | 7561 |
7565 if (x_error_message->string[0]) | 7562 if (x_error_message->string[0]) |
7566 { | 7563 { |
7567 char string[X_ERROR_MESSAGE_SIZE]; | 7564 char string[X_ERROR_MESSAGE_SIZE]; |
7568 bcopy (x_error_message->string, string, X_ERROR_MESSAGE_SIZE); | 7565 bcopy (x_error_message->string, string, X_ERROR_MESSAGE_SIZE); |
7569 x_uncatch_errors (dpy); | 7566 x_uncatch_errors (); |
7570 error (format, string); | 7567 error (format, string); |
7571 } | 7568 } |
7572 } | 7569 } |
7573 | 7570 |
7574 /* Nonzero if we had any X protocol errors | 7571 /* Nonzero if we had any X protocol errors |
7724 } | 7721 } |
7725 | 7722 |
7726 if (dpyinfo) | 7723 if (dpyinfo) |
7727 x_delete_display (dpyinfo); | 7724 x_delete_display (dpyinfo); |
7728 | 7725 |
7729 x_uncatch_errors (dpy); | 7726 x_uncatch_errors (); |
7730 | 7727 |
7731 if (x_display_list == 0) | 7728 if (x_display_list == 0) |
7732 { | 7729 { |
7733 fprintf (stderr, "%s\n", error_msg); | 7730 fprintf (stderr, "%s\n", error_msg); |
7734 shut_down_emacs (0, 0, Qnil); | 7731 shut_down_emacs (0, 0, Qnil); |
9450 names = NULL; | 9447 names = NULL; |
9451 x_clear_errors (dpy); | 9448 x_clear_errors (dpy); |
9452 } | 9449 } |
9453 } | 9450 } |
9454 | 9451 |
9455 x_uncatch_errors (dpy); | 9452 x_uncatch_errors (); |
9456 UNBLOCK_INPUT; | 9453 UNBLOCK_INPUT; |
9457 | 9454 |
9458 if (names) | 9455 if (names) |
9459 { | 9456 { |
9460 int i; | 9457 int i; |
9551 /* This error is perhaps due to insufficient memory on X | 9548 /* This error is perhaps due to insufficient memory on X |
9552 server. Let's just ignore it. */ | 9549 server. Let's just ignore it. */ |
9553 thisinfo = NULL; | 9550 thisinfo = NULL; |
9554 x_clear_errors (dpy); | 9551 x_clear_errors (dpy); |
9555 } | 9552 } |
9556 x_uncatch_errors (dpy); | 9553 x_uncatch_errors (); |
9557 UNBLOCK_INPUT; | 9554 UNBLOCK_INPUT; |
9558 | 9555 |
9559 if (thisinfo) | 9556 if (thisinfo) |
9560 { | 9557 { |
9561 XSETCDR (tem, | 9558 XSETCDR (tem, |
9754 /* This error is perhaps due to insufficient memory on X | 9751 /* This error is perhaps due to insufficient memory on X |
9755 server. Let's just ignore it. */ | 9752 server. Let's just ignore it. */ |
9756 font = NULL; | 9753 font = NULL; |
9757 x_clear_errors (FRAME_X_DISPLAY (f)); | 9754 x_clear_errors (FRAME_X_DISPLAY (f)); |
9758 } | 9755 } |
9759 x_uncatch_errors (FRAME_X_DISPLAY (f)); | 9756 x_uncatch_errors (); |
9760 UNBLOCK_INPUT; | 9757 UNBLOCK_INPUT; |
9761 if (!font) | 9758 if (!font) |
9762 return NULL; | 9759 return NULL; |
9763 | 9760 |
9764 /* Find a free slot in the font table. */ | 9761 /* Find a free slot in the font table. */ |
10539 x_catch_errors (dpy); | 10536 x_catch_errors (dpy); |
10540 if (!XtCallConverter (dpy, XtCvtStringToFont, &d, 1, &fr, &to, NULL)) | 10537 if (!XtCallConverter (dpy, XtCvtStringToFont, &d, 1, &fr, &to, NULL)) |
10541 abort (); | 10538 abort (); |
10542 if (x_had_errors_p (dpy) || !XQueryFont (dpy, font)) | 10539 if (x_had_errors_p (dpy) || !XQueryFont (dpy, font)) |
10543 XrmPutLineResource (&xrdb, "Emacs.dialog.*.font: 9x15"); | 10540 XrmPutLineResource (&xrdb, "Emacs.dialog.*.font: 9x15"); |
10544 x_uncatch_errors (dpy); | 10541 x_uncatch_errors (); |
10545 } | 10542 } |
10546 #endif | 10543 #endif |
10547 #endif | 10544 #endif |
10548 | 10545 |
10549 /* See if we should run in synchronous mode. This is useful | 10546 /* See if we should run in synchronous mode. This is useful |